You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by no...@apache.org on 2009/11/16 13:20:26 UTC

svn commit: r880724 - /incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java

Author: noelgrandin
Date: Mon Nov 16 12:20:25 2009
New Revision: 880724

URL: http://svn.apache.org/viewvc?rev=880724&view=rev
Log:
fix bug: when turning variableItemHeight on/off, we need to run layout

Modified:
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java?rev=880724&r1=880723&r2=880724&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java Mon Nov 16 12:20:25 2009
@@ -384,16 +384,7 @@
 
     @Override
     public Bounds getItemBounds(int index) {
-        int itemY;
-        int itemHeight;
-        if (variableItemHeight) {
-            itemY = variableItemHeightYCache[index];
-            itemHeight = variableItemHeightYCache[index + 1] - itemY;
-        } else {
-            itemY = index * fixedItemHeight;
-            itemHeight = fixedItemHeight;
-        }
-        return new Bounds(0, itemY, getWidth(), itemHeight);
+        return new Bounds(0, getItemY(index), getWidth(), getItemHeight(index));
     }
 
     @Override
@@ -703,7 +694,7 @@
 
     public void setVariableItemHeight(boolean variableItemHeight) {
         this.variableItemHeight = variableItemHeight;
-        repaintComponent();
+        invalidateComponent();
     }