summaryrefslogtreecommitdiffstats
path: root/src/sp-guide.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-08-28 22:53:56 +0000
committerKrzysztof Kosinski <tweenk.pl@gmail.com>2011-08-28 22:53:56 +0000
commitf4b79d4a8edc870f099fb9194c8493ec04012ad1 (patch)
tree2951d5171168abc288c00d09d04f5e5737e779d5 /src/sp-guide.cpp
parentTie the snapping of rectangle corners and quadrant points of ellipses to the ... (diff)
parentCompletely remove libnr (diff)
downloadinkscape-f4b79d4a8edc870f099fb9194c8493ec04012ad1.tar.gz
inkscape-f4b79d4a8edc870f099fb9194c8493ec04012ad1.zip
Completely remove libnr
(bzr r10589)
Diffstat (limited to 'src/sp-guide.cpp')
-rw-r--r--src/sp-guide.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp
index a06d098d0..5d30800d6 100644
--- a/src/sp-guide.cpp
+++ b/src/sp-guide.cpp
@@ -116,7 +116,7 @@ static void sp_guide_class_init(SPGuideClass *gc)
static void sp_guide_init(SPGuide *guide)
{
- guide->normal_to_line = component_vectors[Geom::Y];
+ guide->normal_to_line = Geom::Point(0.,1.);
guide->point_on_line = Geom::Point(0.,0.);
guide->color = 0x0000ff7f;
guide->hicolor = 0xff00007f;
@@ -205,9 +205,9 @@ static void sp_guide_set(SPObject *object, unsigned int key, const gchar *value)
{
if (value && !strcmp(value, "horizontal")) {
/* Visual representation of a horizontal line, constrain vertically (y coordinate). */
- guide->normal_to_line = component_vectors[Geom::Y];
+ guide->normal_to_line = Geom::Point(0., 1.);
} else if (value && !strcmp(value, "vertical")) {
- guide->normal_to_line = component_vectors[Geom::X];
+ guide->normal_to_line = Geom::Point(1., 0.);
} else if (value) {
gchar ** strarray = g_strsplit(value, ",", 2);
double newx, newy;
@@ -220,11 +220,11 @@ static void sp_guide_set(SPObject *object, unsigned int key, const gchar *value)
guide->normal_to_line = direction;
} else {
// default to vertical line for bad arguments
- guide->normal_to_line = component_vectors[Geom::X];
+ guide->normal_to_line = Geom::Point(1., 0.);
}
} else {
// default to vertical line for bad arguments
- guide->normal_to_line = component_vectors[Geom::X];
+ guide->normal_to_line = Geom::Point(1., 0.);
}
sp_guide_set_normal(*guide, guide->normal_to_line, false);
}
@@ -493,11 +493,11 @@ char *sp_guide_description(SPGuide const *guide, const bool verbose)
gchar *shortcuts = g_strdup_printf("; %s", _("<b>Shift+drag</b> to rotate, <b>Ctrl+drag</b> to move origin, <b>Del</b> to delete"));
- if ( are_near(guide->normal_to_line, component_vectors[X]) ||
- are_near(guide->normal_to_line, -component_vectors[X]) ) {
+ if ( are_near(guide->normal_to_line, Geom::Point(1., 0.)) ||
+ are_near(guide->normal_to_line, -Geom::Point(1., 0.)) ) {
descr = g_strdup_printf(_("vertical, at %s"), position_string_x->str);
- } else if ( are_near(guide->normal_to_line, component_vectors[Y]) ||
- are_near(guide->normal_to_line, -component_vectors[Y]) ) {
+ } else if ( are_near(guide->normal_to_line, Geom::Point(0., 1.)) ||
+ are_near(guide->normal_to_line, -Geom::Point(0., 1.)) ) {
descr = g_strdup_printf(_("horizontal, at %s"), position_string_y->str);
} else {
double const radians = guide->angle();