mbien commented on code in PR #9002:
URL: https://github.com/apache/netbeans/pull/9002#discussion_r2515692587


##########
ide/diff/src/org/netbeans/modules/diff/builtin/visualizer/editable/LineNumbersActionsBar.java:
##########
@@ -355,60 +376,57 @@ protected void paintComponent(Graphics gr) {
             idx++;
         }
         hotspots = newActionIcons;
-        
+
         final int linesXOffset = (master.isFirst() ? actionsWidth : 0) + 
LINES_BORDER_WIDTH;
-        
-        g.setFont(getLinesFont()); 
+
+        g.setFont(getLinesFont());
         g.setColor(linesColor);
-        
-        Utilities.runViewHierarchyTransaction(master.getEditorPane(), true, 
new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    View rootView = 
Utilities.getDocumentView(master.getEditorPane());
-                    if(rootView == null) { // this might happen
-                        return;
-                    }
-                    int lineNumber = Utilities.getLineOffset((BaseDocument) 
master.getEditorPane().getDocument(), master.getEditorPane().viewToModel(new 
Point(clip.x, clip.y)));
-                    if (lineNumber > 0) {
-                        --lineNumber;
-                    }
-                    View view = rootView.getView(lineNumber);
-                    if(view == null) { // this might happen
-                        return;
-                    }
-                    Rectangle rec = 
master.getEditorPane().modelToView(view.getStartOffset());
-                    if (rec == null) {
-                        return;
-                    }
-                    int yOffset;
-                    int localLineHeight = rec.height;
-                    int linesDrawn = clip.height / localLineHeight + 4;  // 
draw past clipping rectangle to avoid partially drawn numbers
-                    int docLines = Utilities.getRowCount((BaseDocument) 
master.getEditorPane().getDocument());
-                    if (lineNumber + linesDrawn > docLines) {
-                        linesDrawn = docLines - lineNumber;
+
+        Utilities.runViewHierarchyTransaction(master.getEditorPane(), true, () 
-> {
+            try {
+                View rootView = 
Utilities.getDocumentView(master.getEditorPane());
+                if(rootView == null) { // this might happen
+                    return;
+                }
+                int lineNumber = Utilities.getLineOffset((BaseDocument) 
master.getEditorPane().getDocument(), master.getEditorPane().viewToModel(new 
Point(clip.x, clip.y)));
+                if (lineNumber > 0) {
+                    --lineNumber;
+                }
+                View view = rootView.getView(lineNumber);
+                if(view == null) { // this might happen
+                    return;
+                }
+                Rectangle rec = 
master.getEditorPane().modelToView(view.getStartOffset());
+                if (rec == null) {
+                    return;
+                }
+                int yOffset;
+                int localLineHeight = rec.height;
+                int linesDrawn = clip.height / localLineHeight + 4;  // draw 
past clipping rectangle to avoid partially drawn numbers
+                int docLines = Utilities.getRowCount((BaseDocument) 
master.getEditorPane().getDocument());
+                if (lineNumber + linesDrawn > docLines) {
+                    linesDrawn = docLines - lineNumber;
+                }
+                for (int i = 0; i < linesDrawn; i++) {
+                    view = rootView.getView(lineNumber);
+                    if (view == null) {
+                        break;
                     }
-                    for (int i = 0; i < linesDrawn; i++) {
-                        view = rootView.getView(lineNumber);
-                        if (view == null) {
-                            break;
-                        }
-                        Rectangle rec1 = 
master.getEditorPane().modelToView(view.getStartOffset());
-                        Rectangle rec2 = 
master.getEditorPane().modelToView(view.getEndOffset() - 1);
-                        if (rec1 == null || rec2 == null) {
-                            break;
-                        }
-                        yOffset = rec1.y + rec1.height - rec1.height / 4;
-                        localLineHeight = (int) (rec2.getY() + 
rec2.getHeight() - rec1.getY());

Review Comment:
   was this line (L402) intentionally removed? (this is the cleanup commit btw)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to