[hg] main-silver: #228775 - Background refresh color bug in scri...

  • From: Miloslav Metelka < >
  • To: ,
  • Subject: [hg] main-silver: #228775 - Background refresh color bug in scri...
  • Date: Sun, 01 Sep 2013 03:47:35 -0700

changeset 5d1d2a5c9aa6 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/5d1d2a5c9aa6
description:
        #228775 - Background refresh color bug in script and style areas.

diffstat:

 editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java    
    |  7 ++++++-
 
editor.lib2/src/org/netbeans/modules/editor/lib2/view/ParagraphViewChildren.java
 |  8 +++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diffs (35 lines):

diff --git 
a/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java 
b/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java
--- 
a/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java
+++ 
b/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java
@@ -1018,7 +1018,12 @@
     /**
      * Get displayed portion of the component (either viewport.getViewRect())
      * or (if viewport is missing) size of the component.
-     * @return 
+     * <br/>
+     * Note: The value may be obsolete during paint - clipping bounds may 
already
+     *  incorporate a just performed scroll while visibleRect does not yet.
+     *
+     * @return visible rectangle of the editor either viewport's view or 
editor component
+     *  bounds.
      */
     Rectangle getVisibleRect() {
         return visibleRect;
diff --git 
a/editor.lib2/src/org/netbeans/modules/editor/lib2/view/ParagraphViewChildren.java
 
b/editor.lib2/src/org/netbeans/modules/editor/lib2/view/ParagraphViewChildren.java
--- 
a/editor.lib2/src/org/netbeans/modules/editor/lib2/view/ParagraphViewChildren.java
+++ 
b/editor.lib2/src/org/netbeans/modules/editor/lib2/view/ParagraphViewChildren.java
@@ -449,7 +449,13 @@
                 // Extend till end of screen (docView's width)
                 Rectangle2D.Double childRect = 
ViewUtils.shape2Bounds(childAlloc);
                 DocumentView docView = pView.getDocumentView();
-                childRect.width = docView.op.getVisibleRect().getMaxX() - 
childRect.getX();
+                // Note that op.getVisibleRect() may be obsolete - it does 
not incorporate
+                // possible just performed horizontal scroll while 
clipBounds already does.
+                double maxX = Math.max(
+                        Math.max(docView.op.getVisibleRect().getMaxX(), 
clipBounds.getMaxX()),
+                        childRect.getMaxX()
+                );
+                childRect.width = (maxX - childRect.x);
                 childAlloc = childRect;
             }
             view.paint(g, childAlloc, clipBounds);

[hg] main-silver: #228775 - Background refresh color bug in scri...

Miloslav Metelka 09/01/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 191 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20150626.29986a4). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close