pivot-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From noelgran...@apache.org
Subject svn commit: r1151471 - /pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java
Date Wed, 27 Jul 2011 14:04:24 GMT
Author: noelgrandin
Date: Wed Jul 27 14:04:23 2011
New Revision: 1151471

URL: http://svn.apache.org/viewvc?rev=1151471&view=rev
Log:
PIVOT-772 Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines
exist
scrollToVisible() needs the hierarchy to be layed out so that the sizes of components are
up to date.

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java?rev=1151471&r1=1151470&r2=1151471&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java Wed Jul 27 14:04:23 2011
@@ -1824,7 +1824,13 @@ public abstract class Component implemen
      * @param height
      */
     public void scrollAreaToVisible(int x, int y, int width, int height) {
-        Component component = this;
+        // The calculations need all the component sizes to be up to date, which means the
+        // entire hierarchy has to be layed out.
+        Display display = getDisplay();
+        if (display != null) {
+            display.validate();
+        }
+        Component component = getParent();
 
         while (component != null) {
             if (component instanceof Viewport) {



Mime
View raw message