From 77dc5f1acd4a6b66b2d6fc5c81f7e5c61ef95785 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 5 Aug 2010 02:49:51 +0200 Subject: Wholesale cruft removal part 4; fix crash when rendering guides (bzr r9508.1.48) --- src/draw-context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/draw-context.cpp') diff --git a/src/draw-context.cpp b/src/draw-context.cpp index da22c8a7a..4c1c775df 100644 --- a/src/draw-context.cpp +++ b/src/draw-context.cpp @@ -480,7 +480,7 @@ void spdc_endpoint_snap_rotation(SPEventContext const *const ec, Geom::Point &p, /* mirrored by fabs, so this corresponds to 15 degrees */ Geom::Point best; /* best solution */ - double bn = NR_HUGE; /* best normal */ + double bn = Geom::infinity(); /* best normal */ double bdot = 0; Geom::Point v = Geom::Point(0, 1); double const r00 = cos(M_PI / snaps), r01 = sin(M_PI / snaps); -- cgit v1.2.3 From eed6e9c2c229b10911a23976c47da79fc70a5b87 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 17 Jul 2011 21:47:09 +0200 Subject: - rename SPItem::i2d_affine to i2dt_affine, to clarify that it is item-to-desktop, not item-to-document. This should make it easier to spot bugs. - tag some instances where the document-to-desktop transform has been hardcoded (bzr r10466) --- src/draw-context.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/draw-context.cpp') diff --git a/src/draw-context.cpp b/src/draw-context.cpp index 4dd58afa7..5d324754f 100644 --- a/src/draw-context.cpp +++ b/src/draw-context.cpp @@ -439,7 +439,7 @@ spdc_attach_selection(SPDrawContext *dc, Inkscape::Selection */*sel*/) /* Curve list */ /* We keep it in desktop coordinates to eliminate calculation errors */ SPCurve *norm = sp_path_get_curve_for_edit (SP_PATH(item)); - norm->transform((dc->white_item)->i2d_affine()); + norm->transform((dc->white_item)->i2dt_affine()); g_return_if_fail( norm != NULL ); dc->white_curves = g_slist_reverse(norm->split()); norm->unref(); @@ -821,7 +821,7 @@ void spdc_create_single_dot(SPEventContext *ec, Geom::Point const &pt, char cons current stroke width, multiplied by the amount specified in the preferences */ Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - Geom::Affine const i2d (item->i2d_affine ()); + Geom::Affine const i2d (item->i2dt_affine ()); Geom::Point pp = pt; double rad = 0.5 * prefs->getDouble(tool_path + "/dot-size", 3.0); if (event_state & GDK_MOD1_MASK) { -- cgit v1.2.3 From f4c59e50df9090a1a4801da06f9a0021b67ce7a2 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 8 Oct 2011 22:00:37 +0200 Subject: 1) make snapping to clip/mask paths optional (see document properties dialog -> snap tab) 2) for debugging purposes: code added for showing all snap candidates 3) groundwork for tangential/perpendicular snapping (bzr r10672) --- src/draw-context.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/draw-context.cpp') diff --git a/src/draw-context.cpp b/src/draw-context.cpp index 5d324754f..ebc6e320f 100644 --- a/src/draw-context.cpp +++ b/src/draw-context.cpp @@ -501,7 +501,7 @@ void spdc_endpoint_snap_rotation(SPEventContext const *const ec, Geom::Point &p, } -void spdc_endpoint_snap_free(SPEventContext const * const ec, Geom::Point& p, guint const /*state*/) +void spdc_endpoint_snap_free(SPEventContext const * const ec, Geom::Point& p, boost::optional &start_point, guint const /*state*/) { SPDesktop *dt = SP_EVENT_CONTEXT_DESKTOP(ec); SnapManager &m = dt->namedview->snap_manager; @@ -511,7 +511,7 @@ void spdc_endpoint_snap_free(SPEventContext const * const ec, Geom::Point& p, gu // TODO: Allow snapping to the stationary parts of the item, and only ignore the last segment m.setup(dt, true, selection->singleItem()); - m.freeSnapReturnByRef(p, Inkscape::SNAPSOURCE_NODE_HANDLE); + m.freeSnapReturnByRef(p, Inkscape::SNAPSOURCE_NODE_HANDLE, start_point); m.unSetup(); } -- cgit v1.2.3