You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/08/18 18:20:16 UTC

[GitHub] [netbeans] eirikbakke commented on a change in pull request #3116: [NETBEANS-5931] Consolidate duplicated logic to set rendering hints

eirikbakke commented on a change in pull request #3116:
URL: https://github.com/apache/netbeans/pull/3116#discussion_r691498855



##########
File path: ide/csl.api/src/org/netbeans/modules/csl/editor/completion/MethodParamsTipPaintComponent.java
##########
@@ -51,20 +51,8 @@ public MethodParamsTipPaintComponent(List<List<String>> params, int idx, JTextCo
     }
     
     public @Override void paint(Graphics g) {
-        Object value = (Map) (Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints")); //NOI18N
-        Map renderingHints = (value instanceof Map) ? (java.util.Map) value : null;
-        if (renderingHints != null && g instanceof Graphics2D) {
-            Graphics2D g2d = (Graphics2D) g;
-            RenderingHints oldHints = g2d.getRenderingHints();
-            g2d.setRenderingHints(renderingHints);
-            try {
-                super.paint(g2d);
-            } finally {
-                g2d.setRenderingHints(oldHints);
-            }
-        } else {
-            super.paint(g);
-        }
+        GraphicsUtils.configureRenderingHints(g);
+        super.paint(g);

Review comment:
       Yes, here is one example of a change in behavior. My inclination here is that resetting the hints is unnecessary, and that it would be worth simplifying the code. In the worst case, some other painting code ends up using the leftover hints--but they are the correct hints that should be used throughout the IDE in any case. Any code that wishes to use explicitly different hints had better set their own hints.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists