Rectangle2D bar = ...;
g2.setPaint(gradientPaint);
g2.fill(bar);
g2.setColor(Color.black);
g2.draw(bar);

The issue here is that we could use completely different implementations to handle gradients vs. solid colors and while each of those pipelines enforces consistency between its own fills and draws, they may do so in different ways.

In particular, if this is drawing to the screen or to an accelerated
offscreen, the draw with the black color may be handled by GDI or
X11 or some other platform rendering API, but the Gradients are not
handled directly by most of those platform APIs so we need to switch
to software to do it.  Most of the platform APIs use "round subpixel
coordinates to the nearest integer because the API only allows int
coordinates in the first place" as their technique for controlling
the stroke consistency whereas our software renderers use a more
sophisticated "normalize the coords to a specific sub-pixel offset
that will tend to create less pigeon-holing of wide-line widths"
(similar to the processing done to improve consistency of strokes
in other floating-point capable rendering APIs)...

...jim

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to