From 0783403c257817a1d7b8380431c7f4298e8b02c8 Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Mon, 18 Feb 2019 07:53:13 +0100 Subject: Fix #91 "guides around the page" with y-axis down --- src/object/sp-guide.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/object/sp-guide.cpp') diff --git a/src/object/sp-guide.cpp b/src/object/sp-guide.cpp index 3ed107b81..bbb66aa4a 100644 --- a/src/object/sp-guide.cpp +++ b/src/object/sp-guide.cpp @@ -213,6 +213,13 @@ SPGuide *SPGuide::createSPGuide(SPDocument *doc, Geom::Point const &pt1, Geom::P double newy = pt1.y(); SPRoot *root = doc->getRoot(); + + // stores inverted y-axis coordinates + if (!SP_ACTIVE_DESKTOP || SP_ACTIVE_DESKTOP->is_yaxisdown()) { + newy = doc->getHeight().value("px") - newy; + n[Geom::Y] *= -1.0; + } + if( root->viewBox_set ) { // check to see if scaling is uniform if(Geom::are_near((root->viewBox.width() * root->height.computed) / (root->width.computed * root->viewBox.height()), 1.0, Geom::EPSILON)) { @@ -225,12 +232,6 @@ SPGuide *SPGuide::createSPGuide(SPDocument *doc, Geom::Point const &pt1, Geom::P } } - // stores inverted y-axis coordinates - if (!SP_ACTIVE_DESKTOP || SP_ACTIVE_DESKTOP->is_yaxisdown()) { - newy = doc->getHeight().value("px") - newy; - n[Geom::Y] *= -1.0; - } - sp_repr_set_point(repr, "position", Geom::Point( newx, newy )); sp_repr_set_point(repr, "orientation", n); -- cgit v1.2.3