From 1fa0c72b664afa4803dffd463ed11ce01632ab76 Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Wed, 12 Sep 2018 16:43:47 +0200 Subject: 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 --- src/seltrans.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/seltrans.cpp') 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(); -- cgit v1.2.3