summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-09-30 18:06:07 +0000
committerDavid Robillard <d@drobilla.net>2012-09-30 18:06:07 +0000
commitdbb57216238de87aaf0486862d0395374af14120 (patch)
tree0d1cde19ec81da7f1644304ffd011476db5d8246 /src
parent420bbe77f4b382cc36b21caab5e28710bc7b712f (diff)
downloadganv-dbb57216238de87aaf0486862d0395374af14120.tar.gz
ganv-dbb57216238de87aaf0486862d0395374af14120.tar.bz2
ganv-dbb57216238de87aaf0486862d0395374af14120.zip
Redraw edge areas when edges are removed to avoid fragments.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@4795 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/Canvas.cpp1
-rw-r--r--src/edge.c10
-rw-r--r--src/ganv-private.h6
3 files changed, 12 insertions, 5 deletions
diff --git a/src/Canvas.cpp b/src/Canvas.cpp
index 0fa494e..17a28cf 100644
--- a/src/Canvas.cpp
+++ b/src/Canvas.cpp
@@ -648,6 +648,7 @@ GanvCanvasImpl::remove_edge(GanvEdge* edge)
_selected_edges.erase(edge);
_edges.erase(edge);
_dst_edges.erase(edge);
+ ganv_edge_request_redraw(GANV_ITEM(edge)->canvas, &edge->impl->coords);
gtk_object_destroy(GTK_OBJECT(edge));
}
}
diff --git a/src/edge.c b/src/edge.c
index 2440990..3a34c20 100644
--- a/src/edge.c
+++ b/src/edge.c
@@ -163,9 +163,9 @@ ganv_edge_get_property(GObject* object,
}
}
-static void
-request_redraw(GanvCanvasBase* canvas,
- const GanvEdgeCoords* coords)
+void
+ganv_edge_request_redraw(GanvCanvasBase* canvas,
+ const GanvEdgeCoords* coords)
{
const double w = coords->width;
if (coords->curved) {
@@ -259,7 +259,7 @@ ganv_edge_update(GanvItem* item, int flags)
}
// Request redraw of old location
- request_redraw(item->canvas, &impl->old_coords);
+ ganv_edge_request_redraw(item->canvas, &impl->old_coords);
// Calculate new coordinates from tail and head
GanvEdgeCoords* coords = &impl->coords;
@@ -300,7 +300,7 @@ ganv_edge_update(GanvItem* item, int flags)
ganv_canvas_base_w2c_d(GANV_CANVAS_BASE(item->canvas), x2, y2, &item->x2, &item->y2);
// Request redraw of new location
- request_redraw(item->canvas, &impl->coords);
+ ganv_edge_request_redraw(item->canvas, &impl->coords);
}
static void
diff --git a/src/ganv-private.h b/src/ganv-private.h
index a5d7047..ad36e21 100644
--- a/src/ganv-private.h
+++ b/src/ganv-private.h
@@ -189,6 +189,12 @@ ganv_canvas_port_event(GanvCanvas* canvas,
void
ganv_item_invoke_update(GanvItem* item, int flags);
+/* Edge */
+
+void
+ganv_edge_request_redraw(GanvCanvasBase* canvas,
+ const GanvEdgeCoords* coords);
+
#ifdef __cplusplus
} /* extern "C" */
#endif