Skip to content

Commit da52a1a

Browse files
Tom Wilsonjoshtynjala
authored andcommitted
Fixes group styles contamination among siblings.
1 parent d74c6ef commit da52a1a

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

format/svg/SVGData.hx

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -359,30 +359,21 @@ class SVGData extends Group {
359359

360360

361361
private function getStyles (inNode:Xml, inPrevStyles:StringMap<String>):StringMap <String> {
362-
363-
if (!inNode.exists ("style"))
364-
return inPrevStyles;
365362

366-
var styles = new StringMap <String> ();
367-
368-
if (inPrevStyles != null) {
369-
370-
for (s in inPrevStyles.keys ()) {
371-
372-
styles.set (s, inPrevStyles.get (s));
363+
var styles = inPrevStyles != null ? inPrevStyles.copy() : new StringMap <String> ();
364+
365+
if (inNode.exists ("style")) {
366+
367+
var style = inNode.get ("style");
368+
var strings = mStyleSplit.split (style);
373369

374-
}
370+
for (s in strings) {
375371

376-
}
377-
378-
var style = inNode.get ("style");
379-
var strings = mStyleSplit.split (style);
380-
381-
for (s in strings) {
382-
383-
if (mStyleValue.match (s)) {
384-
385-
styles.set (mStyleValue.matched (1), mStyleValue.matched (2));
372+
if (mStyleValue.match (s)) {
373+
374+
styles.set (mStyleValue.matched (1), mStyleValue.matched (2));
375+
376+
}
386377

387378
}
388379

0 commit comments

Comments
 (0)