Adds minor performance improvement when drawing hidden chars.
@@ -155,20 +155,17 @@ public class AsciiCharacter {
columnIndex *= fontWidth;
rowIndex *= fontHeight;
- BufferedImage image;
+ BufferedImage image = null;
// Handle hidden state:
if (isHidden) {
- final Color color = foregroundColor;
- foregroundColor = backgroundColor;
-
- image = imageCache.retrieveFromCache(this);
-
- foregroundColor = color;
+ gc.setColor(backgroundColor);
+ gc.fillRect(columnIndex, rowIndex, fontWidth, fontHeight);
} else {
image = imageCache.retrieveFromCache(this);
}
+ if (image != null) {
// Handle Horizontal/Vertical Flipping:
if (isFlippedHorizontally || isFlippedVertically) {
AffineTransform tx;
@@ -182,6 +179,7 @@ public class AsciiCharacter {
// Draw character:
gc.drawImage(image, columnIndex, rowIndex, null);
+ }
boundingBox.setLocation(columnIndex, rowIndex);
boundingBox.setSize(fontWidth, fontHeight);
