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 2020/11/03 13:32:20 UTC

[GitHub] [netbeans] sdedic commented on a change in pull request #2509: [NETBEANS-819] partial fix for cursor. Text selection does't work

sdedic commented on a change in pull request #2509:
URL: https://github.com/apache/netbeans/pull/2509#discussion_r515859662



##########
File path: ide/lib.terminalemulator/src/org/netbeans/lib/terminalemulator/MyFontMetrics.java
##########
@@ -142,18 +142,22 @@ public MyFontMetrics(Component component, Font font) {
         height -= leading;
         leading = 0;
 
-        cwidth_cache = CacheFactory.cacheForFontMetrics(fm);
+        cwidth_cache = CacheFactory.cacheForFontMetrics(getFm());
+    }
+
+    public FontMetrics getFm() {
+        return this.cmp.getFontMetrics(cmp.getFont());

Review comment:
       Is it necessary to store `cmp` in order to obtain `getFont` - couldn't be the font obtained / stored rather than the Component ? Not a big deal, but FontMetrics > Component seem as a backward dependency.




----------------------------------------------------------------
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.

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