summaryrefslogtreecommitdiffstats
path: root/src/object/sp-text.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2018-08-27 19:25:53 +0000
committerTavmjong Bah <tavmjong@free.fr>2018-08-27 19:30:40 +0000
commit549f981cbd41532b3b94f38975411f517704166c (patch)
treec00f41804842e424e5dd998bc3b27db6dd04d294 /src/object/sp-text.cpp
parentCMake/MSYS2: Add new pango dependency (libthai) (diff)
downloadinkscape-549f981cbd41532b3b94f38975411f517704166c.tar.gz
inkscape-549f981cbd41532b3b94f38975411f517704166c.zip
Fix rendering when a <tspan> has a CSS 'display' property with value 'none'.
Diffstat (limited to 'src/object/sp-text.cpp')
-rw-r--r--src/object/sp-text.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/object/sp-text.cpp b/src/object/sp-text.cpp
index abb8ac6d8..4739f6b12 100644
--- a/src/object/sp-text.cpp
+++ b/src/object/sp-text.cpp
@@ -599,6 +599,11 @@ unsigned SPText::_buildLayoutInput(SPObject *object, Inkscape::Text::Layout::Opt
int child_attrs_offset = 0;
Inkscape::Text::Layout::OptionalTextTagAttrs optional_attrs;
+ // Per SVG spec, an object with 'display:none' doesn't contribute to text layout.
+ if (object->style->display.computed == SP_CSS_DISPLAY_NONE) {
+ return 0;
+ }
+
if (SP_IS_TEXT(object)) {
SP_TEXT(object)->attributes.mergeInto(&optional_attrs, parent_optional_attrs, parent_attrs_offset, true, true);