summaryrefslogtreecommitdiffstats
path: root/src/sp-marker.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-11-25 14:00:58 +0000
committertavmjong-free <tavmjong@free.fr>2014-11-25 14:00:58 +0000
commit3d5f0a3d4615973d6bd28884085a5653178cb6dd (patch)
tree58bf87e05fe9bbaef6e47e003aeca21a6e74a6b5 /src/sp-marker.cpp
parentIncrease precision of conversion factors to match that of doubles. (diff)
downloadinkscape-3d5f0a3d4615973d6bd28884085a5653178cb6dd.tar.gz
inkscape-3d5f0a3d4615973d6bd28884085a5653178cb6dd.zip
Allow marker orientation to have units ('deg', 'rad', 'grad', 'turn').
(bzr r13757)
Diffstat (limited to 'src/sp-marker.cpp')
-rw-r--r--src/sp-marker.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/sp-marker.cpp b/src/sp-marker.cpp
index e955594ab..1c13a54e6 100644
--- a/src/sp-marker.cpp
+++ b/src/sp-marker.cpp
@@ -168,9 +168,12 @@ void SPMarker::set(unsigned int key, const gchar* value) {
} else if (!strcmp (value, "auto-start-reverse")) {
this->orient_mode = MARKER_ORIENT_AUTO_START_REVERSE;
this->orient_set = TRUE;
- } else if (sp_svg_number_read_f (value, &this->orient)) {
- this->orient_mode = MARKER_ORIENT_ANGLE;
- this->orient_set = TRUE;
+ } else {
+ orient.readOrUnset(value);
+ if (orient._set) {
+ this->orient_mode = MARKER_ORIENT_ANGLE;
+ this->orient_set = orient._set;
+ }
}
}
@@ -273,7 +276,7 @@ Inkscape::XML::Node* SPMarker::write(Inkscape::XML::Document *xml_doc, Inkscape:
} else if (this->orient_mode == MARKER_ORIENT_AUTO_START_REVERSE) {
repr->setAttribute("orient", "auto-start-reverse");
} else {
- sp_repr_set_css_double(repr, "orient", this->orient);
+ sp_repr_set_css_double(repr, "orient", this->orient.computed);
}
} else {
repr->setAttribute("orient", NULL);
@@ -394,7 +397,7 @@ sp_marker_show_instance ( SPMarker *marker, Inkscape::DrawingItem *parent,
m = base;
} else {
/* fixme: Orient units (Lauris) */
- m = Geom::Rotate::from_degrees(marker->orient);
+ m = Geom::Rotate::from_degrees(marker->orient.computed);
m *= Geom::Translate(base.translation());
}
if (marker->markerUnits == SP_MARKER_UNITS_STROKEWIDTH) {