]> err.no Git - libchamplain/commitdiff
Fix behavior in multiple mode
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 28 Jul 2009 00:50:27 +0000 (20:50 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 28 Jul 2009 21:23:18 +0000 (17:23 -0400)
Clicking on one selected marker in a group of selected marker
should highlight only this marker.

champlain/champlain-selection-layer.c

index 4a4ac79745042035122717e6a55c6e35778d9c1b..d881b336d18096ce1a1a96813c39bbf2772f7b8b 100644 (file)
@@ -146,17 +146,15 @@ real_select (ChamplainSelectionLayer *layer,
 
       if (!append)
         champlain_selection_layer_unselect_all (layer);
-
-      if (was_selected)
+      else if (was_selected)
         {
           champlain_selection_layer_unselect (layer, marker);
+          return;
         }
-      else
-        {
-          g_object_ref (marker);
-          g_object_set (marker, "highlighted", TRUE, NULL);
-          layer->priv->selection = g_list_append (layer->priv->selection, marker);
-        }
+
+      g_object_ref (marker);
+      g_object_set (marker, "highlighted", TRUE, NULL);
+      layer->priv->selection = g_list_append (layer->priv->selection, marker);
     }
 }
 
@@ -167,7 +165,8 @@ marker_clicked_cb (ClutterActor *actor,
 {
 
   real_select (CHAMPLAIN_SELECTION_LAYER (user_data),
-      CHAMPLAIN_BASE_MARKER (actor), (event->modifier_state & CLUTTER_CONTROL_MASK));
+      CHAMPLAIN_BASE_MARKER (actor),
+      (event->modifier_state & CLUTTER_CONTROL_MASK));
 
   return TRUE;
 }