You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2011/01/27 22:25:37 UTC
svn commit: r1064317 -
/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java
Author: gbrown
Date: Thu Jan 27 21:25:36 2011
New Revision: 1064317
URL: http://svn.apache.org/viewvc?rev=1064317&view=rev
Log:
Fix bug in calculating preferred width of Border.
Modified:
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java?rev=1064317&r1=1064316&r2=1064317&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java Thu Jan 27 21:25:36 2011
@@ -98,7 +98,7 @@ public class BorderSkin extends Containe
padding.top - padding.bottom, 0);
}
- preferredWidth = content.getPreferredWidth(height);
+ preferredWidth = Math.max(preferredWidth, content.getPreferredWidth(height));
}
preferredWidth += (padding.left + padding.right) + (thickness * 2);
@@ -158,7 +158,7 @@ public class BorderSkin extends Containe
Component content = border.getContent();
if (content != null) {
Dimensions preferredSize = content.getPreferredSize();
- preferredWidth += preferredSize.width;
+ preferredWidth = Math.max(preferredWidth, preferredSize.width);
preferredHeight += preferredSize.height;
}