I’m trying to fix Bug 2659577 right now:
sourceforge.net/tracker/?func=d … tid=594231
What it amounts to is that Boards with no image and no background color
end up painted black (not unlike my formerly red door) by the Image Saver.
The code which is the culprit is here, in Board.java:
if (color != null) {
g.setColor(color);
g.fillRect(visibleRect.x, visibleRect.y,
visibleRect.width, visibleRect.height);
}
else {
g.clearRect(visibleRect.x, visibleRect.y,
visibleRect.width, visibleRect.height);
}
Since the default background color for offscreen images is apparently black,
calling clearRect() when the board has no background color set (color ==
null) means that the snapshot ends up with a black background—which will
generally not be the way the board looks on-screen.
So, here’s the $64k question: Can I just remove the clearRect() call? I know
this will give us the correct behavior for the Image Saver. Will this screw
up anything else? (The limited testing I’ve done shows me that on-screen
painting without clearRect() here seems ok.)