diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Canvas.cpp | 16 | ||||
-rw-r--r-- | src/edge.c | 20 |
2 files changed, 26 insertions, 10 deletions
diff --git a/src/Canvas.cpp b/src/Canvas.cpp index 337cd16..d3055d1 100644 --- a/src/Canvas.cpp +++ b/src/Canvas.cpp @@ -1487,6 +1487,12 @@ Canvas::remove_edge(Node* item1, Node* item2) } } +void +Canvas::remove_edge(Edge* edge) +{ + impl()->remove_edge(edge->gobj()); +} + Edge* Canvas::get_edge(Node* tail, Node* head) const { @@ -1501,8 +1507,14 @@ Canvas::get_edge(Node* tail, Node* head) const void Canvas::for_each_edge(EdgePtrFunc f, void* data) { - FOREACH_EDGE(impl()->_edges, i) { + for (GanvCanvasImpl::Edges::iterator i = impl()->_edges.begin(); + i != impl()->_edges.end();) { + GanvCanvasImpl::Edges::iterator next = i; + ++next; + f((*i), data); + + i = next; } } @@ -1802,7 +1814,7 @@ ganv_canvas_zoom_full(GanvCanvas* canvas) double bottom = DBL_MAX; FOREACH_ITEM(canvas->impl->_items, i) { - double x, y, w, h; + double x = 0.0, y = 0.0, w = 0.0, h = 0.0; g_object_get(G_OBJECT(*i), "x", &x, "y", &y, "w", &w, "h", &h, NULL); if (x < left) left = x; @@ -207,11 +207,13 @@ request_redraw(GanvCanvasBase* canvas, x2 + w, y2 + w); } - ganv_canvas_base_request_redraw(canvas, - coords->handle_x - coords->handle_radius, - coords->handle_y - coords->handle_radius, - coords->handle_x + coords->handle_radius, - coords->handle_y + coords->handle_radius); + if (coords->handle_radius > 0.0) { + ganv_canvas_base_request_redraw(canvas, + coords->handle_x - coords->handle_radius, + coords->handle_y - coords->handle_radius, + coords->handle_x + coords->handle_radius, + coords->handle_y + coords->handle_radius); + } if (coords->arrowhead) { ganv_canvas_base_request_redraw( @@ -420,9 +422,11 @@ ganv_edge_draw(GanvItem* item, cairo_stroke(cr); - cairo_move_to(cr, join_x, join_y); - cairo_arc(cr, join_x, join_y, impl->coords.handle_radius, 0, 2 * G_PI); - cairo_fill(cr); + if (impl->coords.handle_radius > 0.0) { + cairo_move_to(cr, join_x, join_y); + cairo_arc(cr, join_x, join_y, impl->coords.handle_radius, 0, 2 * G_PI); + cairo_fill(cr); + } } static double |