summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/cairo-renderer.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-08-20 11:51:41 +0000
committertavmjong-free <tavmjong@free.fr>2014-08-20 11:51:41 +0000
commit8c009ccdce90c5198260e12ffac837bfdf9b26b7 (patch)
tree15d06a894e294814d86521f10d164b77390d62c5 /src/extension/internal/cairo-renderer.cpp
parentFix gtk3 build (diff)
downloadinkscape-8c009ccdce90c5198260e12ffac837bfdf9b26b7.tar.gz
inkscape-8c009ccdce90c5198260e12ffac837bfdf9b26b7.zip
Implement SVG2 marker 'orient' attribute value 'auto-start-reverse' (rendering only).
(bzr r13341.1.148)
Diffstat (limited to 'src/extension/internal/cairo-renderer.cpp')
-rw-r--r--src/extension/internal/cairo-renderer.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp
index 6fbc85c05..0fec68c06 100644
--- a/src/extension/internal/cairo-renderer.cpp
+++ b/src/extension/internal/cairo-renderer.cpp
@@ -202,8 +202,10 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
if ( shape->_marker[i] ) {
SPMarker* marker = SP_MARKER (shape->_marker[i]);
Geom::Affine tr;
- if (marker->orient_auto) {
+ if (marker->orient_mode == MARKER_ORIENT_AUTO) {
tr = sp_shape_marker_get_transform_at_start(pathv.begin()->front());
+ } else if (marker->orient_mode == MARKER_ORIENT_AUTO_START_REVERSE) {
+ tr = Geom::Rotate::from_degrees( 180.0 ) * sp_shape_marker_get_transform_at_start(pathv.begin()->front());
} else {
tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(pathv.begin()->front().pointAt(0));
}
@@ -220,7 +222,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
&& ! ((path_it == (pathv.end()-1)) && (path_it->size_default() == 0)) ) // if this is the last path and it is a moveto-only, there is no mid marker there
{
Geom::Affine tr;
- if (marker->orient_auto) {
+ if (marker->orient_mode != MARKER_ORIENT_ANGLE) {
tr = sp_shape_marker_get_transform_at_start(path_it->front());
} else {
tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(path_it->front().pointAt(0));
@@ -237,7 +239,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
* Loop to end_default (so including closing segment), because when a path is closed,
* there should be a midpoint marker between last segment and closing straight line segment */
Geom::Affine tr;
- if (marker->orient_auto) {
+ if (marker->orient_mode != MARKER_ORIENT_ANGLE) {
tr = sp_shape_marker_get_transform(*curve_it1, *curve_it2);
} else {
tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(curve_it1->pointAt(1));
@@ -253,7 +255,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
if ( path_it != (pathv.end()-1) && !path_it->empty()) {
Geom::Curve const &lastcurve = path_it->back_default();
Geom::Affine tr;
- if (marker->orient_auto) {
+ if (marker->orient_mode != MARKER_ORIENT_ANGLE) {
tr = sp_shape_marker_get_transform_at_end(lastcurve);
} else {
tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(lastcurve.pointAt(1));
@@ -277,7 +279,7 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx)
Geom::Curve const &lastcurve = path_last[index];
Geom::Affine tr;
- if (marker->orient_auto) {
+ if (marker->orient_mode != MARKER_ORIENT_ANGLE) {
tr = sp_shape_marker_get_transform_at_end(lastcurve);
} else {
tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(lastcurve.pointAt(1));