[ https://issues.apache.org/jira/browse/PIVOT-633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909985#action_12909985 ]
Todd Volkert commented on PIVOT-633: ------------------------------------ I have a suspicious feeling that changing to use the shapes API will *not* fix the scaling issues, based on work I did back when this class was created. Consider this scenario: We have a box pane with a purple background that contains two borders, one yellow, and the other green. When there's no scaling, they all fall evenly on whole pixels, but when scaling is applied, let's say that the two borders each take up a half-pixel where they meet. What you'd expect is the yellow and green to blend in that pixel for smooth rendering, but what actually happens is the yellow blends with the purple, then the green blends with that yellow-purple blend. The result is pretty ugly, and I'm not sure we can get around it. Here's my proposed Way Forward: we change the internals of GraphicsUtilities.drawLine and drawRect to use the corresponding 2D shapes API calls, and if the scaling rendering problems are fixed, then we can use Eclipse's refactoring tools to easily "inline" those method calls, and voilas, the change will have been made. But if the change offers no functional value, then it will be easy to revert just this one file as opposed to all the files that call into it. > 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.