[librsvg/rustification] bgo#776297 - Only render markers on path, line, polyline, polygon elements
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustification] bgo#776297 - Only render markers on path, line, polyline, polygon elements
- Date: Mon, 19 Dec 2016 22:36:38 +0000 (UTC)
commit 6f270cf091190f3e2a264563ad9eddc1c67135ba
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Dec 19 16:33:01 2016 -0600
bgo#776297 - Only render markers on path, line, polyline, polygon elements
Per the spec.
Thanks to Massimo for the test case.
rsvg-base.c | 1 -
rsvg-shapes.c | 4 ++++
.../776297-marker-on-non-path-elements-ref.png | Bin 0 -> 1203 bytes
.../bugs/776297-marker-on-non-path-elements.svg | 16 ++++++++++++++++
4 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/rsvg-base.c b/rsvg-base.c
index b735134..9d9b494 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -2313,7 +2313,6 @@ void
rsvg_render_path_builder (RsvgDrawingCtx * ctx, RsvgPathBuilder *builder)
{
ctx->render->render_path_builder (ctx, builder);
- rsvg_render_markers (ctx, builder);
}
void
diff --git a/rsvg-shapes.c b/rsvg-shapes.c
index 6b79a40..1cddb1a 100644
--- a/rsvg-shapes.c
+++ b/rsvg-shapes.c
@@ -36,6 +36,7 @@
#include "rsvg-css.h"
#include "rsvg-defs.h"
#include "rsvg-path-builder.h"
+#include "rsvg-marker.h"
/* 4/3 * (1-cos 45)/sin 45 = 4/3 * sqrt(2) - 1 */
#define RSVG_ARC_MAGIC ((double) 0.5522847498)
@@ -68,6 +69,7 @@ rsvg_node_path_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
rsvg_state_reinherit_top (ctx, rsvg_node_get_state (self), dominate);
rsvg_render_path_builder (ctx, path->builder);
+ rsvg_render_markers (ctx, path->builder);
}
static void
@@ -185,6 +187,7 @@ _rsvg_node_poly_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
rsvg_state_reinherit_top (ctx, rsvg_node_get_state (self), dominate);
rsvg_render_path_builder (ctx, poly->builder);
+ rsvg_render_markers (ctx, poly->builder);
}
static void
@@ -270,6 +273,7 @@ _rsvg_node_line_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
rsvg_state_reinherit_top (ctx, rsvg_node_get_state (self), dominate);
rsvg_render_path_builder (ctx, builder);
+ rsvg_render_markers (ctx, builder);
rsvg_path_builder_destroy (builder);
}
diff --git a/tests/fixtures/reftests/bugs/776297-marker-on-non-path-elements-ref.png
b/tests/fixtures/reftests/bugs/776297-marker-on-non-path-elements-ref.png
new file mode 100644
index 0000000..1b5634c
Binary files /dev/null and b/tests/fixtures/reftests/bugs/776297-marker-on-non-path-elements-ref.png differ
diff --git a/tests/fixtures/reftests/bugs/776297-marker-on-non-path-elements.svg
b/tests/fixtures/reftests/bugs/776297-marker-on-non-path-elements.svg
new file mode 100644
index 0000000..d8b78f3
--- /dev/null
+++ b/tests/fixtures/reftests/bugs/776297-marker-on-non-path-elements.svg
@@ -0,0 +1,16 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ viewBox="0 0 128 64">
+ <marker id="marker"
+ viewBox="0 -1 4 2"
+ orient="auto">
+ <path fill="blue" d="M 0 -1 L 4 0 0 1" />
+ </marker>
+
+ <path stroke-width="4" marker-mid="url(#marker)"
+ stroke="red" fill="none" d="M 12,12 l 40,0 0,40 -40,0 0,-40"/>
+ <circle stroke-width="4" cx="32" cy="32" r="20" marker-mid="url(#marker)"
+ stroke="red" fill="none"/>
+ <rect stroke-width="4" x="76" y="12" width="40" height="40" marker-mid="url(#marker)"
+ stroke="red" fill="none"/>
+</svg>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]