diff options
| author | Michael Wybrow <michael.wybrow@monash.edu> | 2010-08-13 06:33:53 +0000 |
|---|---|---|
| committer | Michael Wybrow <mjwybrow@users.sf.net> | 2010-08-13 06:33:53 +0000 |
| commit | 7307bcda05bcc0725310ea4a5ab3c0054cdde67b (patch) | |
| tree | 03a663a99e011153c3e7f1d5e37f31215dab6bd0 /src/connector-context.cpp | |
| parent | Fix uniconvertor extensions to work with UC version 1.1.5 (diff) | |
| parent | Fix bug #612756 where connectors with zero length (due to being clipped (diff) | |
| download | inkscape-7307bcda05bcc0725310ea4a5ab3c0054cdde67b.tar.gz inkscape-7307bcda05bcc0725310ea4a5ab3c0054cdde67b.zip | |
Fix bug #612756 where connectors with zero length (due to being clipped
to the perimeter of two overlapping objects) could crash the connector
context.
Fixed bugs:
- https://launchpad.net/bugs/612756
(bzr r9707)
Diffstat (limited to 'src/connector-context.cpp')
| -rw-r--r-- | src/connector-context.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/connector-context.cpp b/src/connector-context.cpp index 3791034d6..1263a9215 100644 --- a/src/connector-context.cpp +++ b/src/connector-context.cpp @@ -1760,12 +1760,22 @@ cc_set_active_conn(SPConnectorContext *cc, SPItem *item) if (cc->active_conn == item) { - // Just adjust handle positions. - Geom::Point startpt = *(curve->first_point()) * i2d; - sp_knot_set_position(cc->endpt_handle[0], startpt, 0); + if (curve->is_empty()) + { + // Connector is invisible because it is clipped to the boundary of + // two overlpapping shapes. + sp_knot_hide(cc->endpt_handle[0]); + sp_knot_hide(cc->endpt_handle[1]); + } + else + { + // Just adjust handle positions. + Geom::Point startpt = *(curve->first_point()) * i2d; + sp_knot_set_position(cc->endpt_handle[0], startpt, 0); - Geom::Point endpt = *(curve->last_point()) * i2d; - sp_knot_set_position(cc->endpt_handle[1], endpt, 0); + Geom::Point endpt = *(curve->last_point()) * i2d; + sp_knot_set_position(cc->endpt_handle[1], endpt, 0); + } return; } @@ -1828,6 +1838,13 @@ cc_set_active_conn(SPConnectorContext *cc, SPItem *item) G_CALLBACK(endpt_handler), cc); } + if (curve->is_empty()) + { + // Connector is invisible because it is clipped to the boundary + // of two overlpapping shapes. So, it doesn't need endpoints. + return; + } + Geom::Point startpt = *(curve->first_point()) * i2d; sp_knot_set_position(cc->endpt_handle[0], startpt, 0); |
