From c8be328d3efd5fb8367451dd8f08badcf015b93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sun, 9 Jun 2013 16:29:50 +0200 Subject: [PATCH] shapes fix --- .../decompiler/flash/types/shaperecords/SHAPERECORD.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/types/shaperecords/SHAPERECORD.java b/trunk/src/com/jpexs/decompiler/flash/types/shaperecords/SHAPERECORD.java index c6e957b16..e67225634 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/shaperecords/SHAPERECORD.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/shaperecords/SHAPERECORD.java @@ -148,6 +148,9 @@ public abstract class SHAPERECORD implements Cloneable, NeedsCharacters { } public void fill(List tags, int startX, int startY, Graphics2D g, int shapeNum) { + if (fillStyle0 == null) { + return; + } AffineTransform oldAf = g.getTransform(); AffineTransform trans20 = AffineTransform.getScaleInstance(1 / DESCALE, 1 / DESCALE); g.setTransform(trans20); @@ -345,8 +348,6 @@ public abstract class SHAPERECORD implements Cloneable, NeedsCharacters { } if (ok) { GeneralPath path = toGeneralPath(startX, startY); - path.closePath(); - //path.setWindingRule(GeneralPath.WIND_EVEN_ODD); g.fill(path); } g.setTransform(oldAf); @@ -821,7 +822,7 @@ public abstract class SHAPERECORD implements Cloneable, NeedsCharacters { } public static BufferedImage shapeToImage(List tags, int shapeNum, FILLSTYLEARRAY fillStyles, LINESTYLEARRAY lineStylesList, List records, Color defaultColor) { - String key = "shape_" + records.hashCode() + "_" + defaultColor.hashCode(); + String key = "shape_" + records.hashCode() + "_" + (defaultColor == null ? "null" : defaultColor.hashCode()); if (cache.containsKey(key)) { return cache.get(key); }