From f2d2c7740567dcf2452c41d8332380708f557157 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Wed, 19 Oct 2016 12:50:29 +0200 Subject: Working with rotate preview (bzr r15142.1.15) --- src/ui/tools/tool-base.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/ui/tools/tool-base.cpp') diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index 8a35882b9..128a09878 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -345,7 +345,6 @@ bool ToolBase::root_handler(GdkEvent* event) { /* sp_desktop_dialog(); */ } break; - case GDK_BUTTON_PRESS: // save drag origin xp = (gint) event->button.x; @@ -446,7 +445,6 @@ bool ToolBase::root_handler(GdkEvent* event) { // do not drag if we're within tolerance from origin break; } - // Once the user has moved farther than tolerance from // the original location (indicating they intend to move // the object, not click), then always process the motion -- cgit v1.2.3 From 50c101849a9f591972b5478a7a83407558e7bff7 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 23 Oct 2016 11:03:35 +0200 Subject: Add right click attempt (bzr r15142.1.20) --- src/ui/tools/tool-base.cpp | 216 ++++++++++++++++++++++++++------------------- 1 file changed, 126 insertions(+), 90 deletions(-) (limited to 'src/ui/tools/tool-base.cpp') diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index 128a09878..d8800284b 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -327,6 +327,7 @@ bool ToolBase::root_handler(GdkEvent* event) { static unsigned int panning = 0; static unsigned int panning_cursor = 0; static unsigned int zoom_rb = 0; + static double angle = 0; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -345,6 +346,7 @@ bool ToolBase::root_handler(GdkEvent* event) { /* sp_desktop_dialog(); */ } break; + case GDK_BUTTON_PRESS: // save drag origin xp = (gint) event->button.x; @@ -393,21 +395,25 @@ bool ToolBase::root_handler(GdkEvent* event) { break; case 3: - if ((event->button.state & GDK_SHIFT_MASK) || (event->button.state & GDK_CONTROL_MASK)) { - // When starting panning, make sure there are no snap events pending because these might disable the panning again - if (_uses_snap) { - sp_event_context_discard_delayed_snap_event(this); - } - panning = 3; - - sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate), - GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK - | GDK_POINTER_MOTION_HINT_MASK, NULL, - event->button.time); - - ret = TRUE; - } else { +// if ((event->button.state & GDK_SHIFT_MASK) || (event->button.state & GDK_CONTROL_MASK)) { +// // When starting panning, make sure there are no snap events pending because these might disable the panning again +// if (_uses_snap) { +// sp_event_context_discard_delayed_snap_event(this); +// } +// panning = 3; + +// sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate), +// GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK +// | GDK_POINTER_MOTION_HINT_MASK, NULL, +// event->button.time); + +// ret = TRUE; +// } else + if( !this->space_panning ) { sp_event_root_menu_popup(desktop, NULL, event); + } else { + panning = 5; + desktop->canvas->startRotateTo(desktop->namedview->document_rotation); } break; @@ -418,7 +424,27 @@ bool ToolBase::root_handler(GdkEvent* event) { case GDK_MOTION_NOTIFY: if (panning) { - if (panning == 4 && !xp && !yp ) { + if (panning == 5) { + button_w = Geom::Point(event->motion.x, event->motion.y); + Geom::Point const motion_dt(desktop->w2d(button_w)); + Geom::Rect view = desktop->get_display_area(); + Geom::Point view_center = desktop->doc2dt(view.midpoint()); + Geom::Ray center_ray(motion_dt,view_center); + if (event->motion.state & GDK_BUTTON3_MASK) { + desktop->canvas->startRotateTo(desktop->namedview->document_rotation); + if (event->motion.state & GDK_SHIFT_MASK) { + angle = floor(center_ray.angle()/5) * 5; + } else if (event->motion.state & GDK_CONTROL_MASK) { + angle = center_ray.angle(); + } else if (event->motion.state & GDK_KEY_Alt_L || + event->motion.state & GDK_KEY_Alt_R){ + angle = desktop->namedview->document_rotation; + } else { + angle = floor(center_ray.angle()); + } + desktop->canvas->rotateTo(desktop->getDrawing(), angle); + } + } else if (panning == 4 && !xp && !yp ) { // + mouse panning started, save location and grab canvas xp = event->motion.x; yp = event->motion.y; @@ -430,41 +456,43 @@ bool ToolBase::root_handler(GdkEvent* event) { | GDK_POINTER_MOTION_HINT_MASK, NULL, event->motion.time - 1); } + if (panning != 5) { + if ((panning == 2 && !(event->motion.state & GDK_BUTTON2_MASK)) + || (panning == 1 && !(event->motion.state & GDK_BUTTON1_MASK)) + || (panning == 3 && !(event->motion.state & GDK_BUTTON3_MASK))) { + /* Gdk seems to lose button release for us sometimes :-( */ + panning = 0; + sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), event->button.time); + ret = TRUE; + } else { + if (within_tolerance && (abs((gint) event->motion.x - xp) + < tolerance) && (abs((gint) event->motion.y - yp) + < tolerance)) { + // do not drag if we're within tolerance from origin + break; + } - if ((panning == 2 && !(event->motion.state & GDK_BUTTON2_MASK)) - || (panning == 1 && !(event->motion.state & GDK_BUTTON1_MASK)) - || (panning == 3 && !(event->motion.state & GDK_BUTTON3_MASK))) { - /* Gdk seems to lose button release for us sometimes :-( */ - panning = 0; - sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), event->button.time); - ret = TRUE; - } else { - if (within_tolerance && (abs((gint) event->motion.x - xp) - < tolerance) && (abs((gint) event->motion.y - yp) - < tolerance)) { - // do not drag if we're within tolerance from origin - break; - } - // Once the user has moved farther than tolerance from - // the original location (indicating they intend to move - // the object, not click), then always process the motion - // notify coordinates as given (no snapping back to origin) - within_tolerance = false; - - // gobble subsequent motion events to prevent "sticking" - // when scrolling is slow - gobble_motion_events(panning == 2 ? GDK_BUTTON2_MASK : (panning - == 1 ? GDK_BUTTON1_MASK : GDK_BUTTON3_MASK)); - - if (panning_cursor == 0) { - panning_cursor = 1; - this->sp_event_context_set_cursor(GDK_FLEUR); - } + // Once the user has moved farther than tolerance from + // the original location (indicating they intend to move + // the object, not click), then always process the motion + // notify coordinates as given (no snapping back to origin) + within_tolerance = false; - Geom::Point const motion_w(event->motion.x, event->motion.y); - Geom::Point const moved_w(motion_w - button_w); - this->desktop->scroll_world(moved_w, true); // we're still scrolling, do not redraw - ret = TRUE; + // gobble subsequent motion events to prevent "sticking" + // when scrolling is slow + gobble_motion_events(panning == 2 ? GDK_BUTTON2_MASK : (panning + == 1 ? GDK_BUTTON1_MASK : GDK_BUTTON3_MASK)); + + if (panning_cursor == 0) { + panning_cursor = 1; + this->sp_event_context_set_cursor(GDK_FLEUR); + } + + Geom::Point const motion_w(event->motion.x, event->motion.y); + Geom::Point const moved_w(motion_w - button_w); + this->desktop->scroll_world(moved_w, true); // we're still scrolling, do not redraw + ret = TRUE; + } } } else if (zoom_rb) { Geom::Point const motion_w(event->motion.x, event->motion.y); @@ -494,60 +522,68 @@ bool ToolBase::root_handler(GdkEvent* event) { break; case GDK_BUTTON_RELEASE: - xp = yp = 0; + if (panning == 5) { + desktop->canvas->endRotateTo(); + sp_repr_set_svg_double(desktop->namedview->getRepr(), "inkscape:document-rotation", angle); + SPObject *updated = SP_OBJECT(desktop->namedview); + if (updated) { + updated->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + } + } else { + xp = yp = 0; + if (panning_cursor == 1) { + panning_cursor = 0; + GtkWidget *w = GTK_WIDGET(this->desktop->getCanvas()); + gdk_window_set_cursor(gtk_widget_get_window (w), this->cursor); + } - if (panning_cursor == 1) { - panning_cursor = 0; - GtkWidget *w = GTK_WIDGET(this->desktop->getCanvas()); - gdk_window_set_cursor(gtk_widget_get_window (w), this->cursor); - } + if (within_tolerance && (panning || zoom_rb)) { + zoom_rb = 0; - if (within_tolerance && (panning || zoom_rb)) { - zoom_rb = 0; + if (panning) { + panning = 0; + sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), + event->button.time); + } - if (panning) { - panning = 0; - sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), - event->button.time); - } + Geom::Point const event_w(event->button.x, event->button.y); + Geom::Point const event_dt(desktop->w2d(event_w)); - Geom::Point const event_w(event->button.x, event->button.y); - Geom::Point const event_dt(desktop->w2d(event_w)); + double const zoom_inc = prefs->getDoubleLimited( + "/options/zoomincrement/value", M_SQRT2, 1.01, 10); - double const zoom_inc = prefs->getDoubleLimited( - "/options/zoomincrement/value", M_SQRT2, 1.01, 10); + desktop->zoom_relative_keep_point(event_dt, (event->button.state + & GDK_SHIFT_MASK) ? 1 / zoom_inc : zoom_inc); - desktop->zoom_relative_keep_point(event_dt, (event->button.state - & GDK_SHIFT_MASK) ? 1 / zoom_inc : zoom_inc); + desktop->updateNow(); + ret = TRUE; + } else if (panning == event->button.button) { + panning = 0; + sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), + event->button.time); - desktop->updateNow(); - ret = TRUE; - } else if (panning == event->button.button) { - panning = 0; - sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), - event->button.time); + // in slow complex drawings, some of the motion events are lost; + // to make up for this, we scroll it once again to the button-up event coordinates + // (i.e. canvas will always get scrolled all the way to the mouse release point, + // even if few intermediate steps were visible) + Geom::Point const motion_w(event->button.x, event->button.y); + Geom::Point const moved_w(motion_w - button_w); - // in slow complex drawings, some of the motion events are lost; - // to make up for this, we scroll it once again to the button-up event coordinates - // (i.e. canvas will always get scrolled all the way to the mouse release point, - // even if few intermediate steps were visible) - Geom::Point const motion_w(event->button.x, event->button.y); - Geom::Point const moved_w(motion_w - button_w); + this->desktop->scroll_world(moved_w); + desktop->updateNow(); + ret = TRUE; + } else if (zoom_rb == event->button.button) { + zoom_rb = 0; - this->desktop->scroll_world(moved_w); - desktop->updateNow(); - ret = TRUE; - } else if (zoom_rb == event->button.button) { - zoom_rb = 0; + Geom::OptRect const b = Inkscape::Rubberband::get(desktop)->getRectangle(); + Inkscape::Rubberband::get(desktop)->stop(); - Geom::OptRect const b = Inkscape::Rubberband::get(desktop)->getRectangle(); - Inkscape::Rubberband::get(desktop)->stop(); + if (b && !within_tolerance) { + desktop->set_display_area(*b, 10); + } - if (b && !within_tolerance) { - desktop->set_display_area(*b, 10); + ret = TRUE; } - - ret = TRUE; } break; -- cgit v1.2.3 From 74edf9fcbc3106cccddb2a293275748fefa08f0b Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 23 Oct 2016 20:04:23 +0200 Subject: Add right click rotation panning (bzr r15142.1.22) --- src/ui/tools/tool-base.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/ui/tools/tool-base.cpp') diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index 87f808039..33c0492d7 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -334,7 +334,6 @@ bool ToolBase::root_handler(GdkEvent* event) { /// @todo REmove redundant /value in preference keys tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); bool allow_panning = prefs->getBool("/options/spacebarpans/value"); - bool clear = true; gint ret = FALSE; switch (event->type) { @@ -346,7 +345,6 @@ bool ToolBase::root_handler(GdkEvent* event) { } else { /* sp_desktop_dialog(); */ } - desktop->canvas->clearRotateTo(); break; case GDK_BUTTON_PRESS: @@ -434,14 +432,13 @@ bool ToolBase::root_handler(GdkEvent* event) { | GDK_POINTER_MOTION_HINT_MASK, NULL, event->motion.time - 1); } else if (this->space_panning && event->motion.state & GDK_BUTTON3_MASK) { - clear = false; sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), event->button.time); desktop->canvas->startRotateTo(desktop->namedview->document_rotation); button_w = Geom::Point(event->motion.x, event->motion.y); - Geom::Point const motion_dt(desktop->w2d(button_w)); + Geom::Point const motion_dt(desktop->doc2dt(desktop->w2d(button_w))); Geom::Rect view = desktop->get_display_area(); Geom::Point view_center = desktop->doc2dt(view.midpoint()); - Geom::Ray center_ray(view_center, motion_dt); + Geom::Ray center_ray(motion_dt, view_center); desktop->canvas->startRotateTo(desktop->namedview->document_rotation); angle = Geom::deg_from_rad(center_ray.angle()) - 90; if (event->motion.state & GDK_SHIFT_MASK && event->motion.state & GDK_CONTROL_MASK) { @@ -583,6 +580,7 @@ bool ToolBase::root_handler(GdkEvent* event) { ret = TRUE; } } + desktop->canvas->clearRotateTo(); break; case GDK_KEY_PRESS: { @@ -752,6 +750,7 @@ bool ToolBase::root_handler(GdkEvent* event) { switch (get_group0_keyval(&event->key)) { case GDK_KEY_space: + desktop->canvas->clearRotateTo(); if (within_tolerance) { // Space was pressed, but not panned sp_toggle_selector(desktop); @@ -773,6 +772,7 @@ bool ToolBase::root_handler(GdkEvent* event) { default: break; } + desktop->canvas->clearRotateTo(); break; case GDK_SCROLL: { @@ -856,7 +856,6 @@ bool ToolBase::root_handler(GdkEvent* event) { default: break; } - desktop->canvas->clearRotateTo(clear); return ret; } -- cgit v1.2.3 From b65d3fdc9c15af81c5e433d8f1b714ef4ab61487 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 23 Oct 2016 21:18:11 +0200 Subject: Add right click rotation panning, some fixes (bzr r15142.1.23) --- src/ui/tools/tool-base.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/ui/tools/tool-base.cpp') diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index 33c0492d7..f7315c648 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -516,7 +516,21 @@ bool ToolBase::root_handler(GdkEvent* event) { break; case GDK_BUTTON_RELEASE: + desktop->canvas->clearRotateTo(); if (this->space_panning && event->button.button == 3) { + xp = yp = 0; + if (panning_cursor == 1) { + panning_cursor = 0; + GtkWidget *w = GTK_WIDGET(this->desktop->getCanvas()); + gdk_window_set_cursor(gtk_widget_get_window (w), this->cursor); + } + zoom_rb = 0; + if (panning) { + panning = 0; + sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), + event->button.time); + } + ret = TRUE; if (desktop->canvas->endRotateTo()) { sp_repr_set_svg_double(desktop->namedview->getRepr(), "inkscape:document-rotation", angle); SPObject *updated = SP_OBJECT(desktop->namedview); @@ -580,7 +594,6 @@ bool ToolBase::root_handler(GdkEvent* event) { ret = TRUE; } } - desktop->canvas->clearRotateTo(); break; case GDK_KEY_PRESS: { -- cgit v1.2.3 From 043578ee79ae7dccc1967a9e380d276c9f73ed46 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Tue, 25 Oct 2016 23:30:06 +0200 Subject: Some bug fixes and improvements (bzr r15142.1.25) --- src/ui/tools/tool-base.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/ui/tools/tool-base.cpp') diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index f7315c648..8d1034161 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -533,10 +533,6 @@ bool ToolBase::root_handler(GdkEvent* event) { ret = TRUE; if (desktop->canvas->endRotateTo()) { sp_repr_set_svg_double(desktop->namedview->getRepr(), "inkscape:document-rotation", angle); - SPObject *updated = SP_OBJECT(desktop->namedview); - if (updated) { - updated->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); - } } } else { xp = yp = 0; -- cgit v1.2.3 From 126cabd5f87ca04262879584dd4ec1ac923edacd Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Tue, 1 Nov 2016 18:01:07 +0100 Subject: Fix angle constrain, thanks to vlada, Mc and LiamW (bzr r15142.1.29) --- src/ui/tools/tool-base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/tools/tool-base.cpp') diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index e1b2f97af..999e2d0b2 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -335,7 +335,7 @@ bool ToolBase::root_handler(GdkEvent* event) { /// @todo REmove redundant /value in preference keys tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); bool allow_panning = prefs->getBool("/options/spacebarpans/value"); - int rotation_snap = prefs->getInt("/options/rotationsnapsperpi/value", 15); + int rotation_snap = 180.0/prefs->getInt("/options/rotationsnapsperpi/value", 12); gint ret = FALSE; switch (event->type) { -- cgit v1.2.3 From bf313d184ec2c93b4605b7c88ed9fcf341510d35 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 5 Nov 2016 18:52:21 +0100 Subject: Change modifier to enter rotate mode from SHIFT to CONTROL (bzr r15142.1.31) --- src/ui/tools/tool-base.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ui/tools/tool-base.cpp') diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index 999e2d0b2..6acbe9f9f 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -376,7 +376,7 @@ bool ToolBase::root_handler(GdkEvent* event) { break; case 2: - if (event->button.state & GDK_MOD1_MASK) { + if (event->button.state & GDK_CONTROL_MASK) { sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), event->button.time); desktop->canvas->startRotateTo(desktop->namedview->document_rotation); this->rotating_mode = true; @@ -406,7 +406,7 @@ bool ToolBase::root_handler(GdkEvent* event) { break; case 3: - if (event->button.state & GDK_MOD1_MASK) { + if (event->button.state & GDK_CONTROL_MASK) { sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), event->button.time); desktop->canvas->startRotateTo(desktop->namedview->document_rotation); this->rotating_mode = true; @@ -742,7 +742,7 @@ bool ToolBase::root_handler(GdkEvent* event) { break; case GDK_KEY_space: - if (event->key.state & GDK_MOD1_MASK) { + if (event->key.state & GDK_CONTROL_MASK) { sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), event->button.time); desktop->canvas->startRotateTo(desktop->namedview->document_rotation); this->rotating_mode = true; -- cgit v1.2.3 From f18cdd20ca7d36fb3b67b4c4b1ae9b315791e02e Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 6 Nov 2016 21:10:58 +0100 Subject: Fix a bug that allow to enter rotate mode with right click (bzr r15142.1.33) --- src/ui/tools/tool-base.cpp | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) (limited to 'src/ui/tools/tool-base.cpp') diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index 6acbe9f9f..fba9ae94f 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -406,34 +406,25 @@ bool ToolBase::root_handler(GdkEvent* event) { break; case 3: - if (event->button.state & GDK_CONTROL_MASK) { - sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), event->button.time); - desktop->canvas->startRotateTo(desktop->namedview->document_rotation); - this->rotating_mode = true; - this->message_context->set(Inkscape::INFORMATION_MESSAGE, - _("Space+ALT+mouse move to rotate canvas")); - } else { - if ((event->button.state & GDK_SHIFT_MASK) || (event->button.state & GDK_CONTROL_MASK)) { - // When starting panning, make sure there are no snap events pending because these might disable the panning again - if (_uses_snap) { - sp_event_context_discard_delayed_snap_event(this); - } - panning = 3; + if ((event->button.state & GDK_SHIFT_MASK) || (event->button.state & GDK_CONTROL_MASK)) { + // When starting panning, make sure there are no snap events pending because these might disable the panning again + if (_uses_snap) { + sp_event_context_discard_delayed_snap_event(this); + } + panning = 3; - sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate), - GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK - | GDK_POINTER_MOTION_HINT_MASK, NULL, - event->button.time); + sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate), + GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK + | GDK_POINTER_MOTION_HINT_MASK, NULL, + event->button.time); - ret = TRUE; - } else if( !this->space_panning) { - sp_event_root_menu_popup(desktop, NULL, event); - } - desktop->canvas->clearRotateTo(); - this->rotating_mode = false; ret = TRUE; - desktop->canvas->endRotateTo(); + } else if( !this->space_panning) { + sp_event_root_menu_popup(desktop, NULL, event); } + desktop->canvas->clearRotateTo(); + this->rotating_mode = false; + ret = TRUE; break; default: -- cgit v1.2.3 From 46d3c703414abe90dfbe79befbd0b4c80a86ea36 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 7 Nov 2016 19:33:24 +0100 Subject: Fix some bugs pointed by vlada (bzr r15142.1.35) --- src/ui/tools/tool-base.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/ui/tools/tool-base.cpp') diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index fba9ae94f..c789b44bb 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -381,7 +381,7 @@ bool ToolBase::root_handler(GdkEvent* event) { desktop->canvas->startRotateTo(desktop->namedview->document_rotation); this->rotating_mode = true; this->message_context->set(Inkscape::INFORMATION_MESSAGE, - _("Space+ALT+mouse move to rotate canvas")); + _("MMB + mouse move to rotate canvas, use modifiers on screen to change snaps")); } else { if (event->button.state & GDK_SHIFT_MASK) { zoom_rb = 2; @@ -397,10 +397,7 @@ bool ToolBase::root_handler(GdkEvent* event) { | GDK_POINTER_MOTION_HINT_MASK, NULL, event->button.time - 1); } - desktop->canvas->clearRotateTo(); - this->rotating_mode = false; ret = TRUE; - desktop->canvas->endRotateTo(); } ret = TRUE; break; @@ -422,8 +419,6 @@ bool ToolBase::root_handler(GdkEvent* event) { } else if( !this->space_panning) { sp_event_root_menu_popup(desktop, NULL, event); } - desktop->canvas->clearRotateTo(); - this->rotating_mode = false; ret = TRUE; break; @@ -464,7 +459,7 @@ bool ToolBase::root_handler(GdkEvent* event) { | GDK_POINTER_MOTION_HINT_MASK, NULL, event->motion.time - 1); } - if (panning) { + if (panning && !this->rotating_mode) { if ((panning == 2 && !(event->motion.state & GDK_BUTTON2_MASK)) || (panning == 1 && !(event->motion.state & GDK_BUTTON1_MASK)) || (panning == 3 && !(event->motion.state & GDK_BUTTON3_MASK))) { @@ -738,7 +733,7 @@ bool ToolBase::root_handler(GdkEvent* event) { desktop->canvas->startRotateTo(desktop->namedview->document_rotation); this->rotating_mode = true; this->message_context->set(Inkscape::INFORMATION_MESSAGE, - _("Space+ALT+mouse move to rotate canvas")); + _("Space+mouse move to rotate canvas, use modifiers on screen to change snaps")); } else { within_tolerance = true; xp = yp = 0; -- cgit v1.2.3 From 7f2d487d23d4b0e95ceb8d1cc4ad6ffb18a32f90 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 7 Nov 2016 19:53:29 +0100 Subject: Fix some bugs (bzr r15142.1.37) --- src/ui/tools/tool-base.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ui/tools/tool-base.cpp') diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index c789b44bb..ca700f652 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -373,6 +373,8 @@ bool ToolBase::root_handler(GdkEvent* event) { ret = TRUE; } + desktop->canvas->clearRotateTo(); + this->rotating_mode = false; break; case 2: @@ -420,6 +422,8 @@ bool ToolBase::root_handler(GdkEvent* event) { sp_event_root_menu_popup(desktop, NULL, event); } ret = TRUE; + desktop->canvas->clearRotateTo(); + this->rotating_mode = false; break; default: @@ -836,9 +840,7 @@ bool ToolBase::root_handler(GdkEvent* event) { if (this->rotating_mode) { desktop->canvas->clearRotateTo(); this->rotating_mode = false; - ret = TRUE; desktop->canvas->endRotateTo(); - break; } bool ctrl = (event->scroll.state & GDK_CONTROL_MASK); bool wheelzooms = prefs->getBool("/options/wheelzooms/value"); -- cgit v1.2.3