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/seltrans.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/seltrans.cpp')
| -rw-r--r-- | src/seltrans.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 837f0da0e..ce7c63b04 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -278,6 +278,10 @@ void Inkscape::SelTrans::grab(Geom::Point const &p, gdouble x, gdouble y, bool s _items_centers.push_back(it->getCenter()); // for content-dragging, we need to remember original centers } + if (y != -1 && _desktop->is_yaxisdown()) { + y = 1 - y; + } + _handle_x = x; _handle_y = y; @@ -631,12 +635,14 @@ void Inkscape::SelTrans::_showHandles(SPSelTransType type) // shouldn't have nullary bbox, but knots g_assert(_bbox); + auto const y_dir = _desktop->yaxisdir(); + for (int i = 0; i < NUMHANDS; i++) { if (hands[i].type != type) continue; // Position knots to scale the selection bbox - Geom::Point const bpos(hands[i].x, hands[i].y); + Geom::Point const bpos(hands[i].x, (hands[i].y - 0.5) * (-y_dir) + 0.5); Geom::Point p(_bbox->min() + (_bbox->dimensions() * Geom::Scale(bpos))); knots[i]->moveto(p); knots[i]->show(); |
