diff options
| author | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-03-07 21:15:29 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mailat-signdiedenrezidotnl> | 2010-03-07 21:15:29 +0000 |
| commit | 37c29b32271d6de635d6f6827d70ffb7865fe3b6 (patch) | |
| tree | 38c5484aca343f1cc24bc279ca6e72c9d71b5f15 /src/desktop-events.cpp | |
| parent | While dragging or rotating a guide, <shift>-key now disables snapping. (Just ... (diff) | |
| download | inkscape-37c29b32271d6de635d6f6827d70ffb7865fe3b6.tar.gz inkscape-37c29b32271d6de635d6f6827d70ffb7865fe3b6.zip | |
1) When rotating a guide, don't try to snap when <ctrl> 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
(bzr r9160)
Diffstat (limited to 'src/desktop-events.cpp')
| -rw-r--r-- | src/desktop-events.cpp | 26 |
1 files 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; |
