diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2018-09-12 14:43:47 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2018-09-12 14:43:47 +0000 |
| commit | 1fa0c72b664afa4803dffd463ed11ce01632ab76 (patch) | |
| tree | c1f746d4e8f7a5d65541cf6c05d3cdc79b3f9c10 /src/ui/tools/select-tool.cpp | |
| parent | Fix preferences crash (diff) | |
| download | inkscape-1fa0c72b664afa4803dffd463ed11ce01632ab76.tar.gz inkscape-1fa0c72b664afa4803dffd463ed11ce01632ab76.zip | |
New option to invert y-axis
Replaces all hard coded or implicit desktop coordinate usage with
doc2dt multiplication.
New global preference: Interface > Origin at upper left
https://bugs.launchpad.net/inkscape/+bug/170049
Diffstat (limited to 'src/ui/tools/select-tool.cpp')
| -rw-r--r-- | src/ui/tools/select-tool.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ui/tools/select-tool.cpp b/src/ui/tools/select-tool.cpp index 92ae7558b..6e8d631df 100644 --- a/src/ui/tools/select-tool.cpp +++ b/src/ui/tools/select-tool.cpp @@ -906,6 +906,7 @@ bool SelectTool::root_handler(GdkEvent* event) { gdouble const nudge = prefs->getDoubleLimited("/options/nudgedistance/value", 2, 0, 1000, "px"); // in px gdouble const offset = prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000, "px"); int const snaps = prefs->getInt("/options/rotationsnapsperpi/value", 12); + auto const y_dir = desktop->yaxisdir(); switch (get_latin_keyval (&event->key)) { case GDK_KEY_Left: // move selection left @@ -935,6 +936,7 @@ bool SelectTool::root_handler(GdkEvent* event) { case GDK_KEY_KP_Up: if (!MOD__CTRL(event)) { // not ctrl gint mul = 1 + gobble_key_events(get_latin_keyval(&event->key), 0); // with any mask + mul *= -y_dir; if (MOD__ALT(event)) { // alt if (MOD__SHIFT(event)) { @@ -981,6 +983,7 @@ bool SelectTool::root_handler(GdkEvent* event) { case GDK_KEY_KP_Down: if (!MOD__CTRL(event)) { // not ctrl gint mul = 1 + gobble_key_events(get_latin_keyval(&event->key), 0); // with any mask + mul *= -y_dir; if (MOD__ALT(event)) { // alt if (MOD__SHIFT(event)) { @@ -1038,9 +1041,9 @@ bool SelectTool::root_handler(GdkEvent* event) { gint mul = 1 + gobble_key_events(get_latin_keyval(&event->key), 0); // with any mask selection->rotateScreen(mul*1); } else if (MOD__CTRL(event)) { - selection->rotate(90); + selection->rotate(-90 * y_dir); } else if (snaps) { - selection->rotate(180.0/snaps); + selection->rotate(-180.0/snaps * y_dir); } ret = TRUE; @@ -1051,9 +1054,9 @@ bool SelectTool::root_handler(GdkEvent* event) { gint mul = 1 + gobble_key_events(get_latin_keyval(&event->key), 0); // with any mask selection->rotateScreen(-1*mul); } else if (MOD__CTRL(event)) { - selection->rotate(-90); + selection->rotate(90 * y_dir); } else if (snaps) { - selection->rotate(-180.0/snaps); + selection->rotate(180.0/snaps * y_dir); } ret = TRUE; |
