summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2019-03-05 19:52:17 +0000
committerMartin Owens <doctormo@gmail.com>2019-03-05 19:52:17 +0000
commit90ab3e514e96681b65eecb14d873fb78f31ee353 (patch)
tree34001be5d65e30105f282361ce268b7249355324 /src
parentRestore set_extensions_env() (diff)
downloadinkscape-90ab3e514e96681b65eecb14d873fb78f31ee353.tar.gz
inkscape-90ab3e514e96681b65eecb14d873fb78f31ee353.zip
Fix inverted direction with on canvas align handles
Diffstat (limited to 'src')
-rw-r--r--src/seltrans-handles.h24
-rw-r--r--src/seltrans.cpp12
2 files changed, 31 insertions, 5 deletions
diff --git a/src/seltrans-handles.h b/src/seltrans-handles.h
index e224d4e7d..1c54e376f 100644
--- a/src/seltrans-handles.h
+++ b/src/seltrans-handles.h
@@ -40,7 +40,7 @@ enum SPSelTransType {
};
// Which handle does what in the alignment (clicking)
-const int AlignVerb[18] = {
+const int AlignVerb[36] = {
// Left Click
SP_VERB_ALIGN_VERTICAL_TOP,
SP_VERB_ALIGN_HORIZONTAL_RIGHT,
@@ -61,11 +61,33 @@ const int AlignVerb[18] = {
SP_VERB_ALIGN_BOTH_TOP_LEFT_TO_ANCHOR,
SP_VERB_ALIGN_BOTH_BOTTOM_LEFT_TO_ANCHOR,
SP_VERB_ALIGN_BOTH_BOTTOM_RIGHT_TO_ANCHOR,
+
+ // Oposite Canvas direction
+ SP_VERB_ALIGN_VERTICAL_TOP,
+ SP_VERB_ALIGN_HORIZONTAL_RIGHT,
+ SP_VERB_ALIGN_VERTICAL_BOTTOM,
+ SP_VERB_ALIGN_HORIZONTAL_LEFT,
+ SP_VERB_ALIGN_VERTICAL_CENTER,
+ SP_VERB_ALIGN_BOTH_TOP_LEFT,
+ SP_VERB_ALIGN_BOTH_TOP_RIGHT,
+ SP_VERB_ALIGN_BOTH_BOTTOM_RIGHT,
+ SP_VERB_ALIGN_BOTH_BOTTOM_LEFT,
+ // Shift Click
+ SP_VERB_ALIGN_VERTICAL_BOTTOM_TO_ANCHOR,
+ SP_VERB_ALIGN_HORIZONTAL_LEFT_TO_ANCHOR,
+ SP_VERB_ALIGN_VERTICAL_TOP_TO_ANCHOR,
+ SP_VERB_ALIGN_HORIZONTAL_RIGHT_TO_ANCHOR,
+ SP_VERB_ALIGN_HORIZONTAL_CENTER,
+ SP_VERB_ALIGN_BOTH_BOTTOM_RIGHT_TO_ANCHOR,
+ SP_VERB_ALIGN_BOTH_BOTTOM_LEFT_TO_ANCHOR,
+ SP_VERB_ALIGN_BOTH_TOP_LEFT_TO_ANCHOR,
+ SP_VERB_ALIGN_BOTH_TOP_RIGHT_TO_ANCHOR,
};
// Ofset from the index in the handle list to the index in the verb list.
const int AlignHandleToVerb = -13;
// Offset for moving from Left click to Shift Click
const int AlignShiftVerb = 9;
+const int AlignOrientVerb = 18;
struct SPSelTransTypeInfo {
guint32 const *color;
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index bd8483a6f..46cf9d88b 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -1356,12 +1356,16 @@ void Inkscape::SelTrans::align(guint state, SPSelTransHandle const &handle)
bool sel_as_group = prefs->getBool("/dialogs/align/sel-as-groups");
int align_to = prefs->getInt("/dialogs/align/align-to", 6);
- int verb_id = -1;
+ int verb_offset = 0;
if (state & GDK_SHIFT_MASK) {
- verb_id = AlignVerb[handle.control + AlignHandleToVerb + AlignShiftVerb];
- } else {
- verb_id = AlignVerb[handle.control + AlignHandleToVerb];
+ verb_offset += AlignShiftVerb;
+ }
+ if (!this->_desktop->is_yaxisdown()) {
+ verb_offset += AlignOrientVerb;
}
+
+ int verb_id = AlignVerb[handle.control + AlignHandleToVerb + verb_offset];
+
if(verb_id >= 0) {
prefs->setBool("/dialogs/align/sel-as-groups", (state & GDK_CONTROL_MASK) != 0);
prefs->setInt("/dialogs/align/align-to", 6);