Commit dfaa5a55 authored by Nathan Lee's avatar Nathan Lee

Fix rotation for a couple shortcuts when y-axis down

(cherry picked from commit 352041f2)
parent b3bd13f2
Pipeline #143506797 passed with stages
in 91 minutes and 44 seconds
......@@ -184,6 +184,7 @@ bool Box3dTool::root_handler(GdkEvent* event) {
static bool dragging;
SPDocument *document = desktop->getDocument();
auto const y_dir = desktop->yaxisdir();
Inkscape::Selection *selection = desktop->getSelection();
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
int const snaps = prefs->getInt("/options/rotationsnapsperpi/value", 12);
......@@ -352,42 +353,42 @@ bool Box3dTool::root_handler(GdkEvent* event) {
break;
case GDK_KEY_bracketright:
persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::X, -180/snaps, MOD__ALT(event));
persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::X, 180 / snaps * y_dir, MOD__ALT(event));
DocumentUndo::done(document, SP_VERB_CONTEXT_3DBOX,
_("Change perspective (angle of PLs)"));
ret = true;
break;
case GDK_KEY_bracketleft:
persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::X, 180/snaps, MOD__ALT(event));
persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::X, -180 / snaps * y_dir, MOD__ALT(event));
DocumentUndo::done(document, SP_VERB_CONTEXT_3DBOX,
_("Change perspective (angle of PLs)"));
ret = true;
break;
case GDK_KEY_parenright:
persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::Y, -180/snaps, MOD__ALT(event));
persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::Y, 180 / snaps * y_dir, MOD__ALT(event));
DocumentUndo::done(document, SP_VERB_CONTEXT_3DBOX,
_("Change perspective (angle of PLs)"));
ret = true;
break;
case GDK_KEY_parenleft:
persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::Y, 180/snaps, MOD__ALT(event));
persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::Y, -180 / snaps * y_dir, MOD__ALT(event));
DocumentUndo::done(document, SP_VERB_CONTEXT_3DBOX,
_("Change perspective (angle of PLs)"));
ret = true;
break;
case GDK_KEY_braceright:
persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::Z, -180/snaps, MOD__ALT(event));
persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::Z, 180 / snaps * y_dir, MOD__ALT(event));
DocumentUndo::done(document, SP_VERB_CONTEXT_3DBOX,
_("Change perspective (angle of PLs)"));
ret = true;
break;
case GDK_KEY_braceleft:
persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::Z, 180/snaps, MOD__ALT(event));
persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::Z, -180 / snaps * y_dir, MOD__ALT(event));
DocumentUndo::done(document, SP_VERB_CONTEXT_3DBOX,
_("Change perspective (angle of PLs)"));
ret = true;
......
......@@ -1037,7 +1037,7 @@ bool SelectTool::root_handler(GdkEvent* event) {
case GDK_KEY_bracketleft:
if (MOD__ALT(event)) {
gint mul = 1 + gobble_key_events(get_latin_keyval(&event->key), 0); // with any mask
selection->rotateScreen(mul*1);
selection->rotateScreen(-mul * y_dir);
} else if (MOD__CTRL(event)) {
selection->rotate(-90 * y_dir);
} else if (snaps) {
......@@ -1050,7 +1050,7 @@ bool SelectTool::root_handler(GdkEvent* event) {
case GDK_KEY_bracketright:
if (MOD__ALT(event)) {
gint mul = 1 + gobble_key_events(get_latin_keyval(&event->key), 0); // with any mask
selection->rotateScreen(-1*mul);
selection->rotateScreen(mul * y_dir);
} else if (MOD__CTRL(event)) {
selection->rotate(90 * y_dir);
} else if (snaps) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment