summaryrefslogtreecommitdiffstats
path: root/src/sp-guide.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-12-23 21:52:23 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-12-23 21:52:23 +0000
commit2e58689bdfe85ae19d8e4f26851d51c4e8f0b909 (patch)
tree22dfce008e10e079b37038bfc8ec9dad505bb339 /src/sp-guide.cpp
parentRetired FilePrintDirect verb (diff)
downloadinkscape-2e58689bdfe85ae19d8e4f26851d51c4e8f0b909.tar.gz
inkscape-2e58689bdfe85ae19d8e4f26851d51c4e8f0b909.zip
fix angle description of guides
(bzr r4288)
Diffstat (limited to 'src/sp-guide.cpp')
-rw-r--r--src/sp-guide.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp
index 7ee29e231..26d60601c 100644
--- a/src/sp-guide.cpp
+++ b/src/sp-guide.cpp
@@ -33,6 +33,7 @@
#include "inkscape.h"
#include "desktop.h"
#include "sp-namedview.h"
+#include <2geom/angle.h>
using std::vector;
@@ -367,11 +368,9 @@ char *sp_guide_description(SPGuide const *guide)
} else if ( guide->normal_to_line == component_vectors[Y] ) {
return g_strdup_printf(_("horizontal guideline at %s"), position_string_y->str);
} else {
- double const radians = atan2(guide->normal_to_line[X],
- guide->normal_to_line[Y]);
- /* flip y axis and rotate 90 degrees to convert to line angle */
- double const degrees = ( radians / M_PI ) * 180.0;
- int const degrees_int = (int) floor( degrees + .5 );
+ double const radians = guide->angle();
+ double const degrees = Geom::rad_to_deg(radians);
+ int const degrees_int = (int) round(degrees);
return g_strdup_printf("%d degree guideline at (%s,%s)", degrees_int, position_string_x->str, position_string_y->str);
/* Alternative suggestion: "angled guideline". */
}