[ 
https://issues.apache.org/jira/browse/PIVOT-633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910119#action_12910119
 ] 

Greg Brown commented on PIVOT-633:
----------------------------------

It does actually fix the scaling issue. I have seen it myself, having already 
made the changes to the button and table view header skins. Before this change, 
we ran into rounding errors - sometimes the line was rounded up, and sometimes 
down, which produced a noticeable inconsistency. This doesn't happen when using 
the Java2D primitives - it renderers correctly regardless of scale.

I'm not sure we'll ever run into the issue of 1/2 pixel overlap - all of our 
"pixels" are still specified in integers. All this change does is allow Java2D 
to correctly round those values when we scale them.

Re-implementing those methods in terms of the Graphics primitives is probably a 
good start. However, I don't think I'd want to blindly inline the method 
implementations, since that may not produce the most efficient or readable code 
(for example, we'll always need to create a new Stroke if we inline, but we may 
not always need to do that in practice).


> Eliminate use of GraphicsUtilities.drawRect() and drawLine()
> ------------------------------------------------------------
>
>                 Key: PIVOT-633
>                 URL: https://issues.apache.org/jira/browse/PIVOT-633
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Priority: Minor
>             Fix For: 2.0
>
>
> These methods were originally created to provide better rendering behavior 
> than the corresponding java.awt.Graphics#drawRect() and drawLine() classes. 
> However, a better approach is to call Graphics2D#draw() with a Rectangle2D or 
> a Line2D. This produces much better results when the display is scaled, since 
> these primitives use true floating point values.
> A number of components including most buttons have already been updated to 
> use the java.awt.geom classes, but many skins are still using 
> GraphicsUtilities and should also be updated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to