Comment #1 on issue 213 by atdi...@gmail.com: artifacts in JComponent border using PSwing
http://code.google.com/p/piccolo2d/issues/detail?id=213

Interesting, MatteBorder doesn't do this. In you code, replace LineBorder with:

setBorder(BorderFactory.createMatteBorder(10,10,10,10,Color.blue));

LineBorder's implementation (the jdk source code that comes w/ MacOS) of paintBorder() looks like this:

        for(i = 0; i < thickness; i++)  {
            g.drawRect(x + i, y + i, width - i - i - 1, height - i - i - 1);
        }

It just draws a consecutive of rectangles. I think when the Graphics object is scaled this approach is leaving whitespace between the consecutive lines.

MatteBorder's implementation uses fillRects instead of consecutive of single-pixel-width rectangles.

Not sure what Piccolo2D can do about this. I suppose we could detect the use of LineBorder and recover from their implementation (ie., reimplement the painting of LineBorders ourself to do something like what Matte does.)

--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en

Reply via email to