summaryrefslogtreecommitdiffstats
path: root/src/object/sp-guide.cpp
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2019-02-18 06:53:13 +0000
committerThomas Holder <thomas@thomas-holder.de>2019-02-18 06:53:13 +0000
commit0783403c257817a1d7b8380431c7f4298e8b02c8 (patch)
tree4318466ee15ed56c1c58ada425d885aca1a21f6a /src/object/sp-guide.cpp
parentMerge branch 'nathanal/inkscape-golden-ratio-patch' (diff)
downloadinkscape-0783403c257817a1d7b8380431c7f4298e8b02c8.tar.gz
inkscape-0783403c257817a1d7b8380431c7f4298e8b02c8.zip
Fix #91 "guides around the page" with y-axis down
Diffstat (limited to 'src/object/sp-guide.cpp')
-rw-r--r--src/object/sp-guide.cpp13
1 files changed, 7 insertions, 6 deletions
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();
+
+ // <sodipodi:guide> 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
}
}
- // <sodipodi:guide> 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);