From e88644b0f3481c78a9563dbf9ee6b76ab6674583 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 13 Feb 2018 15:48:14 +0100 Subject: Promote the path 'd' attribute to a property per SVG 2. This allows 'd' to be animated via CSS animations. Due to the interactions of 'd' with LPE's, 'd' as a property is converted to 'd' as an attribute in SPPath::update. This changes the XML which causes update() to be called again (and triggers a warning). Fixing this is left to a future patch as is converting the 'd' back to a property on output. --- src/style.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/style.cpp') diff --git a/src/style.cpp b/src/style.cpp index 3298cb0c9..b3bbcbe45 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -97,6 +97,10 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) : // font-family // font-specification + + // SVG 2 attributes promoted to properties. (When geometry properties are added, move after font.) + d( "d" ), // SPIString Not inherited! + // Font related properties and 'font' shorthand font_style( "font-style", enum_font_style, SP_CSS_FONT_STYLE_NORMAL ), font_variant( "font-variant", enum_font_variant, SP_CSS_FONT_VARIANT_NORMAL ), @@ -282,6 +286,9 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) : // This might be too resource hungary... but for now it possible to loop over properties + // SVG 2: Attributes promoted to properties + _properties.push_back( &d ); + // 'color' must be before 'fill', 'stroke', 'text-decoration-color', ... _properties.push_back( &color ); @@ -702,6 +709,9 @@ SPStyle::readIfUnset( gint id, gchar const *val, SPStyleSrc const &source ) { g_return_if_fail(val != NULL); switch (id) { + case SP_ATTR_D: + d.readIfUnset( val, source ); + break; case SP_PROP_INKSCAPE_FONT_SPEC: font_specification.readIfUnset( val, source ); break; -- cgit v1.2.3