summaryrefslogtreecommitdiffstats
path: root/src/sp-marker.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-11-23 23:36:49 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-11-23 23:36:49 +0000
commit0969085ddf607a7a98cf7fd6d9b10da5fbebe62d (patch)
tree59b2bc9ed3412ab2de4c703ef30342dfe2401704 /src/sp-marker.cpp
parentrefactor from lastApplied (diff)
parentFixed a bug pointed by suv running from comand line, also removed another des... (diff)
downloadinkscape-0969085ddf607a7a98cf7fd6d9b10da5fbebe62d.tar.gz
inkscape-0969085ddf607a7a98cf7fd6d9b10da5fbebe62d.zip
fixing to trunk
(bzr r12588.1.34)
Diffstat (limited to '')
-rw-r--r--src/sp-marker.cpp (renamed from src/marker.cpp)43
1 files changed, 26 insertions, 17 deletions
diff --git a/src/marker.cpp b/src/sp-marker.cpp
index 7fee16ead..e955594ab 100644
--- a/src/marker.cpp
+++ b/src/sp-marker.cpp
@@ -24,7 +24,7 @@
#include "display/drawing-group.h"
#include "xml/repr.h"
#include "attributes.h"
-#include "marker.h"
+#include "sp-marker.h"
#include "document.h"
#include "document-private.h"
#include "preferences.h"
@@ -52,7 +52,7 @@ SPMarker::SPMarker() : SPGroup(), SPViewBox() {
this->markerUnits = 0;
this->markerUnits_set = 0;
- this->orient_auto = 0;
+ this->orient_mode = MARKER_ORIENT_ANGLE;
this->orient_set = 0;
this->orient = 0;
@@ -158,16 +158,20 @@ void SPMarker::set(unsigned int key, const gchar* value) {
case SP_ATTR_ORIENT:
this->orient_set = FALSE;
- this->orient_auto = FALSE;
+ this->orient_mode = MARKER_ORIENT_ANGLE;
this->orient = 0.0;
if (value) {
- if (!strcmp (value, "auto")) {
- this->orient_auto = TRUE;
- this->orient_set = TRUE;
- } else if (sp_svg_number_read_f (value, &this->orient)) {
- this->orient_set = TRUE;
- }
+ if (!strcmp (value, "auto")) {
+ this->orient_mode = MARKER_ORIENT_AUTO;
+ this->orient_set = TRUE;
+ } 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;
+ }
}
this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
@@ -264,15 +268,17 @@ Inkscape::XML::Node* SPMarker::write(Inkscape::XML::Document *xml_doc, Inkscape:
}
if (this->orient_set) {
- if (this->orient_auto) {
- repr->setAttribute("orient", "auto");
- } else {
- sp_repr_set_css_double(repr, "orient", this->orient);
- }
+ if (this->orient_mode == MARKER_ORIENT_AUTO) {
+ repr->setAttribute("orient", "auto");
+ } 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);
+ }
} else {
- repr->setAttribute("orient", NULL);
+ repr->setAttribute("orient", NULL);
}
-
+
/* fixme: */
//XML Tree being used directly here while it shouldn't be....
repr->setAttribute("viewBox", this->getRepr()->attribute("viewBox"));
@@ -381,7 +387,10 @@ sp_marker_show_instance ( SPMarker *marker, Inkscape::DrawingItem *parent,
}
if (v->items[pos]) {
Geom::Affine m;
- if (marker->orient_auto) {
+ if (marker->orient_mode == MARKER_ORIENT_AUTO) {
+ m = base;
+ } else if (marker->orient_mode == MARKER_ORIENT_AUTO_START_REVERSE) {
+ m = Geom::Rotate::from_degrees( 180.0 ) * base;
m = base;
} else {
/* fixme: Orient units (Lauris) */