From: Pierre-Luc Beaudoin Date: Tue, 28 Jul 2009 00:50:27 +0000 (-0400) Subject: Fix behavior in multiple mode X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fa51eb3441b50483d1dd5672dc20bff3247c5df;p=libchamplain Fix behavior in multiple mode Clicking on one selected marker in a group of selected marker should highlight only this marker. --- diff --git a/champlain/champlain-selection-layer.c b/champlain/champlain-selection-layer.c index 4a4ac79..d881b33 100644 --- a/champlain/champlain-selection-layer.c +++ b/champlain/champlain-selection-layer.c @@ -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; }