summaryrefslogtreecommitdiffstats
path: root/src/display/curve.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mailat-signdiedenrezidotnl>2010-04-22 20:42:03 +0000
committerDiederik van Lierop <mailat-signdiedenrezidotnl>2010-04-22 20:42:03 +0000
commitf5fe904a389f1ea866c783a03fdf70df466e055f (patch)
tree0bc6303563cea29214cb9a1726c695a81d029544 /src/display/curve.cpp
parentTranslations. en_GB translation update by Tim Sheridan. fr translation update... (diff)
downloadinkscape-f5fe904a389f1ea866c783a03fdf70df466e055f.tar.gz
inkscape-f5fe904a389f1ea866c783a03fdf70df466e055f.zip
Fix snapping regression introduced by rev. #9118
Fixed bugs: - https://launchpad.net/bugs/562205 (bzr r9364)
Diffstat (limited to 'src/display/curve.cpp')
-rw-r--r--src/display/curve.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 1b54c981c..73b8dc36d 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -44,7 +44,7 @@ SPCurve::SPCurve(Geom::PathVector const& pathv)
}
SPCurve *
-SPCurve::new_from_rect(Geom::Rect const &rect)
+SPCurve::new_from_rect(Geom::Rect const &rect, bool all_four_sides)
{
SPCurve *c = new SPCurve();
@@ -54,7 +54,16 @@ SPCurve::new_from_rect(Geom::Rect const &rect)
for (int i=3; i>=1; i--) {
c->lineto(rect.corner(i));
}
- c->closepath();
+
+ if (all_four_sides) {
+ // When _constrained_ snapping to a path, the 2geom::SimpleCrosser will be invoked which doesn't consider the closing segment.
+ // of a path. Consequently, in case we want to snap to for example the page border, we must provide all four sides of the
+ // rectangle explicitly
+ c->lineto(rect.corner(0));
+ } else {
+ // ... instead of just three plus a closing segment
+ c->closepath();
+ }
return c;
}