summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f2f5734)
raw | patch | inline | side by side (parent: f2f5734)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Tue, 20 May 2008 19:21:01 +0000 (19:21 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Tue, 20 May 2008 19:21:01 +0000 (19:21 +0000) |
src/arc-context.cpp | patch | blob | history | |
src/rect-context.cpp | patch | blob | history | |
src/spiral-context.cpp | patch | blob | history | |
src/star-context.cpp | patch | blob | history |
diff --git a/src/arc-context.cpp b/src/arc-context.cpp
index 45b67a7dcbc5e8a0e85a276c2f2ddb7320dbc77d..e3dc7161c290df51cb7a0b9f5827a81d8da92345 100644 (file)
--- a/src/arc-context.cpp
+++ b/src/arc-context.cpp
@@ -262,6 +262,11 @@ static gint sp_arc_context_root_handler(SPEventContext *event_context, GdkEvent
dragging = true;
ac->center = Inkscape::setup_for_drag_start(desktop, event_context, event);
+
+ /* Snap center */
+ SnapManager &m = desktop->namedview->snap_manager;
+ m.setup(desktop, NULL); //null, because we don't have an item yet
+ m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, ac->center);
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
ac->item->updateRepr();
sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5);
-
- /* Snap center */
- SnapManager &m = desktop->namedview->snap_manager;
- m.setup(desktop, ac->item);
- m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, ac->center);
}
bool ctrl_save = false;
diff --git a/src/rect-context.cpp b/src/rect-context.cpp
index d1e5fe3817a66c0e4d7fb98b2b62feede493ec7d..f53a399482ee40915684f56a1932f5e31759bae1 100644 (file)
--- a/src/rect-context.cpp
+++ b/src/rect-context.cpp
@@ -304,6 +304,11 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
NR::Point const button_dt(desktop->w2d(button_w));
rc->center = button_dt;
+ /* Snap center */
+ SnapManager &m = desktop->namedview->snap_manager;
+ m.setup(desktop, NULL); //null, because we don't have an item yet
+ m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, rc->center);
+
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
( GDK_KEY_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
rc.item->updateRepr();
sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5);
-
- /* Snap center */
- SnapManager &m = desktop->namedview->snap_manager;
- m.setup(desktop, rc.item);
- m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, rc.center);
}
NR::Rect const r = Inkscape::snap_rectangular_box(desktop, rc.item, pt, rc.center, state);
diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp
index 31ec40d5033eb357536740029678d56ba298dc92..e868593697e30ab300571ddb76e02deb07deb7d8 100644 (file)
--- a/src/spiral-context.cpp
+++ b/src/spiral-context.cpp
sc->center = Inkscape::setup_for_drag_start(desktop, event_context, event);
SnapManager &m = desktop->namedview->snap_manager;
- m.setup(desktop, sc->item);
+ m.setup(desktop, NULL); //null, because we don't have an item yet
m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, sc->center);
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
diff --git a/src/star-context.cpp b/src/star-context.cpp
index b6b3c340e01a15286b10676eaf518861eb808478..1b3b1e7b05c25ec0b096409fb8f2a1839383eb58 100644 (file)
--- a/src/star-context.cpp
+++ b/src/star-context.cpp
@@ -279,10 +279,11 @@ static gint sp_star_context_root_handler(SPEventContext *event_context, GdkEvent
dragging = TRUE;
sc->center = Inkscape::setup_for_drag_start(desktop, event_context, event);
-
+
+ /* Snap center */
SnapManager &m = desktop->namedview->snap_manager;
- m.setup(desktop, sc->item);
- m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, sc->center);
+ m.setup(desktop, NULL); //null, because we don't have an item yet
+ m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, sc->center);
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
@@ -305,11 +306,7 @@ static gint sp_star_context_root_handler(SPEventContext *event_context, GdkEvent
event_context->within_tolerance = false;
NR::Point const motion_w(event->motion.x, event->motion.y);
- NR::Point motion_dt(event_context->desktop->w2d(motion_w));
-
- SnapManager &m = desktop->namedview->snap_manager;
- m.setup(desktop, sc->item);
- m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt);
+ NR::Point motion_dt(desktop->w2d(motion_w));
sp_star_drag (sc, motion_dt, event->motion.state);
sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5);
}
- NR::Point const p0 = sp_desktop_dt2root_xy_point(desktop, sc->center);
- NR::Point p1 = sp_desktop_dt2root_xy_point(desktop, p);
-
/* Snap corner point with no constraints */
SnapManager &m = desktop->namedview->snap_manager;
m.setup(desktop, sc->item);
- m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, p1);
-
+ m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, p);
+
+ NR::Point const p0 = sp_desktop_dt2root_xy_point(desktop, sc->center);
+ NR::Point p1 = sp_desktop_dt2root_xy_point(desktop, p);
+
SPStar *star = SP_STAR(sc->item);
double const sides = (gdouble) sc->magnitude;