diff options
author | David Robillard <d@drobilla.net> | 2011-12-23 19:55:15 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-12-23 19:55:15 +0000 |
commit | 0316028e51b17a933be001719c9f69ba5097be03 (patch) | |
tree | f121cf496f349ce1299e73f424b8a669195f03fe /src | |
parent | 3d325ba4047580cc228780c19997675626c3b7ca (diff) | |
download | ganv-0316028e51b17a933be001719c9f69ba5097be03.tar.gz ganv-0316028e51b17a933be001719c9f69ba5097be03.tar.bz2 ganv-0316028e51b17a933be001719c9f69ba5097be03.zip |
Fix every port drawn after a selected port also appearing selected.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@3903 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/Canvas.cpp | 16 | ||||
-rw-r--r-- | src/box.c | 2 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/Canvas.cpp b/src/Canvas.cpp index e057bc1..69fabf6 100644 --- a/src/Canvas.cpp +++ b/src/Canvas.cpp @@ -192,7 +192,7 @@ struct GanvCanvasImpl { typedef std::set<GanvEdge*, TailHeadOrder> Edges; typedef std::set<GanvEdge*, HeadTailOrder> DstEdges; typedef std::set<GanvEdge*> SelectedEdges; - typedef std::list<GanvPort*> SelectedPorts; + typedef std::set<GanvPort*> SelectedPorts; Edges::const_iterator first_edge_from(const GanvNode* src); DstEdges::const_iterator first_edge_to(const GanvNode* dst); @@ -234,9 +234,9 @@ struct GanvCanvasImpl { Items _selected_items; ///< Currently selected items SelectedEdges _selected_edges; ///< Currently selected edges - SelectedPorts _selected_ports; ///< Selected ports (hilited red) - GanvPort* _connect_port; ///< Port for which a edge is being made - GanvPort* _last_selected_port; + SelectedPorts _selected_ports; ///< Selected ports (hilited red) + GanvPort* _connect_port; ///< Port for which a edge is being made + GanvPort* _last_selected_port; GanvBox* _select_rect; ///< Rectangle for drag selection @@ -623,9 +623,7 @@ GanvCanvasImpl::select_port(GanvPort* p, bool unique) unselect_ports(); } g_object_set(G_OBJECT(p), "selected", TRUE, NULL); - SelectedPorts::iterator i = find(_selected_ports.begin(), _selected_ports.end(), p); - if (i == _selected_ports.end()) - _selected_ports.push_back(p); + _selected_ports.insert(p); _last_selected_port = p; } @@ -683,9 +681,7 @@ GanvCanvasImpl::select_port_toggle(GanvPort* port, int mod_state) void GanvCanvasImpl::unselect_port(GanvPort* p) { - SelectedPorts::iterator i = find(_selected_ports.begin(), _selected_ports.end(), p); - if (i != _selected_ports.end()) - _selected_ports.erase(i); + _selected_ports.erase(p); g_object_set(G_OBJECT(p), "selected", FALSE, NULL); if (_last_selected_port == p) { _last_selected_port = NULL; @@ -274,6 +274,8 @@ ganv_box_draw(GanvItem* item, cairo_set_line_width(cr, impl->coords.border_width); if (dash_length > 0) { cairo_set_dash(cr, &dash_length, 1, box->node.impl->dash_offset); + } else { + cairo_set_dash(cr, &dash_length, 0, 0); } } cairo_stroke(cr); |