From aa2ee418d70eefc6038d5bca4d7b0b29abf98e17 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sun, 7 Mar 2010 22:15:29 +0100 Subject: [PATCH] 1) When rotating a guide, don't try to snap when is pressed to constrain to angle increments 2) When dragging the guide origin along the guide, then don't change the mousepointer to the rotation arrows if shift is pressed --- src/desktop-events.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp index 89f530d95..810f501d7 100644 --- a/src/desktop-events.cpp +++ b/src/desktop-events.cpp @@ -297,7 +297,9 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) m.guideConstrainedSnap(motion_dt, *guide); } } else if (!(event->motion.state & GDK_SHIFT_MASK)) { - m.guideFreeSnap(motion_dt, guide->normal_to_line, drag_type); + if (!((drag_type == SP_DRAG_ROTATE) && (event->motion.state & GDK_CONTROL_MASK))) { + m.guideFreeSnap(motion_dt, guide->normal_to_line, drag_type); + } } switch (drag_type) { @@ -310,7 +312,7 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) { Geom::Point pt = motion_dt - guide->point_on_line; double angle = std::atan2(pt[Geom::Y], pt[Geom::X]); - if (event->motion.state & GDK_CONTROL_MASK) { + if (event->motion.state & GDK_CONTROL_MASK) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); unsigned const snaps = abs(prefs->getInt("/options/rotationsnapsperpi/value", 12)); if (snaps) { @@ -360,7 +362,9 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) m.guideConstrainedSnap(event_dt, *guide); } } else if (!(event->button.state & GDK_SHIFT_MASK)) { - m.guideFreeSnap(event_dt, guide->normal_to_line, drag_type); + if (!((drag_type == SP_DRAG_ROTATE) && (event->motion.state & GDK_CONTROL_MASK))) { + m.guideFreeSnap(event_dt, guide->normal_to_line, drag_type); + } } if (sp_canvas_world_pt_inside_window(item->canvas, event_w)) { @@ -420,7 +424,7 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) Geom::Point const event_w(event->crossing.x, event->crossing.y); Geom::Point const event_dt(desktop->w2d(event_w)); - if (event->crossing.state & GDK_SHIFT_MASK) { + if ((event->crossing.state & GDK_SHIFT_MASK) && (drag_type != SP_DRAG_MOVE_ORIGIN)) { GdkCursor *guide_cursor; guide_cursor = gdk_cursor_new (GDK_EXCHANGE); gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, guide_cursor); @@ -455,11 +459,15 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) } case GDK_Shift_L: case GDK_Shift_R: - GdkCursor *guide_cursor; - guide_cursor = gdk_cursor_new (GDK_EXCHANGE); - gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, guide_cursor); - gdk_cursor_unref(guide_cursor); - ret = TRUE; + if (drag_type != SP_DRAG_MOVE_ORIGIN) { + GdkCursor *guide_cursor; + guide_cursor = gdk_cursor_new (GDK_EXCHANGE); + gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, guide_cursor); + gdk_cursor_unref(guide_cursor); + ret = TRUE; + break; + } + default: // do nothing; break; -- 2.30.2