Error color (red) extracted to constant in SWF class

This commit is contained in:
Jindra Petřík
2022-11-05 10:27:33 +01:00
parent 1d82af4855
commit dfca43736e
6 changed files with 11 additions and 8 deletions

View File

@@ -377,6 +377,11 @@ public final class SWF implements SWFContainerItem, Timelined {
"CFX", // Compressed ScaleForm GFx
"ABC" // Non-standard LZMA compressed Flash
);
/**
* Color to paint when there is an error (missing image, ...)
*/
public static final Color ERROR_COLOR = Color.red;
public void updateCharacters() {
characters = null;

View File

@@ -378,8 +378,7 @@ public class BitmapExporter extends ShapeExporterBase {
}
}
// fill with red in case any error
fillPaint = Color.RED;
fillPaint = SWF.ERROR_COLOR;
fillTransform = matrix.toTransform();
}
@@ -576,8 +575,7 @@ public class BitmapExporter extends ShapeExporterBase {
}
}
// fill with red in case any error
linePaint = Color.RED;
linePaint = SWF.ERROR_COLOR;
lineTransform = matrix.toTransform();
}

View File

@@ -277,7 +277,7 @@ public class CanvasShapeExporter extends ShapeExporterBase {
}
}
fillData.append("\tctx.fillStyle=").append(color(Color.RED.getRGB())).append(";\r\n");
fillData.append("\tctx.fillStyle=").append(color(SWF.ERROR_COLOR.getRGB())).append(";\r\n");
}
@Override

View File

@@ -126,7 +126,7 @@ public class DefineExternalImage extends ImageTag {
serImage = new SerializableImage(targetWidth, targetHeight, BufferedImage.TYPE_INT_ARGB_PRE);
Graphics g = serImage.getGraphics();
g.setColor(Color.red);
g.setColor(SWF.ERROR_COLOR);
g.fillRect(0, 0, targetWidth, targetHeight);
cachedImageFilename = null;
}

View File

@@ -138,7 +138,7 @@ public class DefineExternalImage2 extends ImageTag {
serImage = new SerializableImage(targetWidth, targetHeight, BufferedImage.TYPE_INT_ARGB_PRE);
Graphics g = serImage.getGraphics();
g.setColor(Color.red);
g.setColor(SWF.ERROR_COLOR);
g.fillRect(0, 0, targetWidth, targetHeight);
cachedImageFilename = null;
}

View File

@@ -158,7 +158,7 @@ public class DefineSubImage extends ImageTag {
}
serImage = new SerializableImage(x2 - x1, y2 - y1, BufferedImage.TYPE_INT_ARGB_PRE);
Graphics g = serImage.getGraphics();
g.setColor(Color.red);
g.setColor(SWF.ERROR_COLOR);
g.fillRect(0, 0, x2 - x1, y2 - y1);
cachedImageFilename = null;
cachedX1 = x1;