Skip to content

Commit

Permalink
Fix order of concatentation of nested transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
stuikomma authored and t-oster committed Apr 25, 2019
1 parent 5e57910 commit 57b7c89
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -26,6 +26,7 @@
import java.awt.Rectangle;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -82,11 +83,13 @@ public AffineTransform getAbsoluteTransformation() throws SVGException
if (this.getDecoratee() != null)
{
AffineTransform tr = new AffineTransform();
for (Object o : this.getPathToRoot())
List<SVGElement> pathToRoot = this.getPathToRoot();
Collections.reverse(pathToRoot);
for (Object o : pathToRoot)
{
if (o instanceof Group)
{
StyleAttribute sty = new StyleAttribute("transform");
StyleAttribute sty = new StyleAttribute("transform");
if (((SVGElement) o).getPres(sty))
{
String value = sty.getStringValue();
Expand All @@ -96,8 +99,7 @@ public AffineTransform getAbsoluteTransformation() throws SVGException
if (!"".equals(v))
{
AffineTransform trans = SVGElement.parseSingleTransform(v+")");
trans.concatenate(tr);
tr = trans;
tr.concatenate(trans);
}
}
}
Expand Down

0 comments on commit 57b7c89

Please sign in to comment.