r1152834 backed out most of r1151471, but not the line that seems to
be the cause of the problem.

On 1 September 2011 05:35, Chris Bartlett <[email protected]> wrote:
> This commit looks to have introduced a problem with scrolling.
>
> Specifically this change
>> -        Component component = this;
>> +        Component component = getParent();
>
> Run this...
> java org.apache.pivot.wtk.DesktopApplicationContext
> org.apache.pivot.wtk.ScriptApplication
> --src=/org/apache/pivot/tutorials/lists/list_views.bxml
>
> Use the keyboard to move to item 'Ten' and then try to move back to item 'One'
> The selected list item should remain visible when using the arrow keys
> to move up and down in the ListView.  It worked fine in v2.0, but in
> the current trunk version, the up key press doesn't scroll properly
> (the down key seems OK).
>
> The same tutorial is also at
> http://pivot.apache.org/tutorials/lists.html
>
> Unfortunately I stumbled on this today while I am struggling to get my
> dev workstation running properly again after upgrading Eclipse &
> various other software, so even tracking down this commit took a
> while.  I want to rule out anything weird  going on with my box, so
> would appreciate if anyone else can check and try to reproduce this
> with a recent build.
>
> Chris
>
> On 27 July 2011 21:04,  <[email protected]> wrote:
>> 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) {
>>
>>
>>
>

Reply via email to