summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2019-08-14 17:16:52 +0000
committerThomas Holder <thomas@thomas-holder.de>2019-08-14 17:16:52 +0000
commit54d04963a68415518b3487cd7172ee9834e42d86 (patch)
treed7ea5b3224dae7071247fc72f105f0642e235fe8 /src
parentfix "File > Quit" heap-use-after-free (diff)
downloadinkscape-54d04963a68415518b3487cd7172ee9834e42d86.tar.gz
inkscape-54d04963a68415518b3487cd7172ee9834e42d86.zip
fix #371 guides label upside down
Diffstat (limited to 'src')
-rw-r--r--src/display/guideline.cpp2
-rw-r--r--src/object/sp-guide.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/display/guideline.cpp b/src/display/guideline.cpp
index 8d738cdb2..d2816f179 100644
--- a/src/display/guideline.cpp
+++ b/src/display/guideline.cpp
@@ -111,7 +111,7 @@ static void sp_guideline_render(SPCanvasItem *item, SPCanvasBuf *buf)
int py = round(point_on_line_dt[Geom::Y]);
cairo_save(buf->ct);
cairo_translate(buf->ct, px, py);
- cairo_rotate(buf->ct, atan2(normal_dt.cw()));
+ cairo_rotate(buf->ct, atan2(normal_dt.cw()) + M_PI * (desktop && desktop->is_yaxisdown() ? 1 : 0));
cairo_translate(buf->ct, 0, -5);
cairo_move_to(buf->ct, 0, 0);
cairo_show_text(buf->ct, gl->label);
diff --git a/src/object/sp-guide.cpp b/src/object/sp-guide.cpp
index 6230e10eb..38924de50 100644
--- a/src/object/sp-guide.cpp
+++ b/src/object/sp-guide.cpp
@@ -131,7 +131,7 @@ void SPGuide::set(SPAttributeEnum key, const gchar *value) {
// <sodipodi:guide> stores inverted y-axis coordinates
if (document->is_yaxisdown()) {
- direction[Geom::Y] *= -1.0;
+ direction[Geom::X] *= -1.0;
}
direction.normalize();
@@ -217,7 +217,7 @@ SPGuide *SPGuide::createSPGuide(SPDocument *doc, Geom::Point const &pt1, Geom::P
// <sodipodi:guide> stores inverted y-axis coordinates
if (doc->is_yaxisdown()) {
newy = doc->getHeight().value("px") - newy;
- n[Geom::Y] *= -1.0;
+ n[Geom::X] *= -1.0;
}
if( root->viewBox_set ) {
@@ -442,7 +442,7 @@ void SPGuide::set_normal(Geom::Point const normal_to_line, bool const commit)
// <sodipodi:guide> stores inverted y-axis coordinates
if (document->is_yaxisdown()) {
- normal[Geom::Y] *= -1.0;
+ normal[Geom::X] *= -1.0;
}
sp_repr_set_point(getRepr(), "orientation", normal);