summaryrefslogtreecommitdiffstats
path: root/src/style.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2008-04-08 08:12:54 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2008-04-08 08:12:54 +0000
commit6b08fcf1f3704b14e1f935e2d5c990ec9bd49287 (patch)
treed6822e82df8d63e696665f353fff09d969632687 /src/style.cpp
parentcmake: add CheckStructMember.cmake from KDE. enable struct checks (does this ... (diff)
downloadinkscape-6b08fcf1f3704b14e1f935e2d5c990ec9bd49287.tar.gz
inkscape-6b08fcf1f3704b14e1f935e2d5c990ec9bd49287.zip
since marker size depends on stroke width, write stroke width if there's no stroke but there are markers
(bzr r5384)
Diffstat (limited to 'src/style.cpp')
-rw-r--r--src/style.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/style.cpp b/src/style.cpp
index 45a560d27..46ff51e18 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -2233,9 +2233,17 @@ sp_style_write_string(SPStyle const *const style, guint const flags)
p += sp_style_write_ipaint(p, c + BMAX - p, "stroke", &style->stroke, NULL, flags);
+ // stroke width affects markers, so write it if there's stroke OR any markers
+ if (!style->stroke.noneSet ||
+ style->marker[SP_MARKER_LOC].set ||
+ style->marker[SP_MARKER_LOC_START].set ||
+ style->marker[SP_MARKER_LOC_MID].set ||
+ style->marker[SP_MARKER_LOC_END].set) {
+ p += sp_style_write_ilength(p, c + BMAX - p, "stroke-width", &style->stroke_width, NULL, flags);
+ }
+
// if stroke:none, skip writing stroke properties
if (!style->stroke.noneSet) {
- p += sp_style_write_ilength(p, c + BMAX - p, "stroke-width", &style->stroke_width, NULL, flags);
p += sp_style_write_ienum(p, c + BMAX - p, "stroke-linecap", enum_stroke_linecap, &style->stroke_linecap, NULL, flags);
p += sp_style_write_ienum(p, c + BMAX - p, "stroke-linejoin", enum_stroke_linejoin, &style->stroke_linejoin, NULL, flags);
p += sp_style_write_ifloat(p, c + BMAX - p, "stroke-miterlimit", &style->stroke_miterlimit, NULL, flags);
@@ -2374,9 +2382,18 @@ sp_style_write_difference(SPStyle const *const from, SPStyle const *const to)
}
p += sp_style_write_ipaint(p, c + BMAX - p, "stroke", &from->stroke, &to->stroke, SP_STYLE_FLAG_IFDIFF);
+
+ // stroke width affects markers, so write it if there's stroke OR any markers
+ if (!from->stroke.noneSet ||
+ from->marker[SP_MARKER_LOC].set ||
+ from->marker[SP_MARKER_LOC_START].set ||
+ from->marker[SP_MARKER_LOC_MID].set ||
+ from->marker[SP_MARKER_LOC_END].set) {
+ p += sp_style_write_ilength(p, c + BMAX - p, "stroke-width", &from->stroke_width, &to->stroke_width, SP_STYLE_FLAG_IFDIFF);
+ }
+
// if stroke:none, skip writing stroke properties
if (!from->stroke.noneSet) {
- p += sp_style_write_ilength(p, c + BMAX - p, "stroke-width", &from->stroke_width, &to->stroke_width, SP_STYLE_FLAG_IFDIFF);
p += sp_style_write_ienum(p, c + BMAX - p, "stroke-linecap", enum_stroke_linecap,
&from->stroke_linecap, &to->stroke_linecap, SP_STYLE_FLAG_IFDIFF);
p += sp_style_write_ienum(p, c + BMAX - p, "stroke-linejoin", enum_stroke_linejoin,