summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorAutomerge <automerge@vaadin.com>2012-04-27 11:39:27 +0000
committerAutomerge <automerge@vaadin.com>2012-04-27 11:39:27 +0000
commitf4f4783d7f3e65c5395a519778f231c3e528cb6c (patch)
treefc8c2b52a3907ac0e833f33b31484b603567b991 /src/com
parent48893c2135d66a0de2c24acec3e7fb659ec85f7f (diff)
downloadvaadin-framework-f4f4783d7f3e65c5395a519778f231c3e528cb6c.tar.gz
vaadin-framework-f4f4783d7f3e65c5395a519778f231c3e528cb6c.zip
[merge from 6.7] Fix and test case for #8619: Add sanity checks to GridLayout to handle cases where the size of a relative-size child unexpectedly changes
svn changeset:23656/svn branch:6.8
Diffstat (limited to 'src/com')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java
index 82b3eabf40..ba37148c36 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java
@@ -29,6 +29,7 @@ import com.vaadin.terminal.gwt.client.RenderSpace;
import com.vaadin.terminal.gwt.client.StyleConstants;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
+import com.vaadin.terminal.gwt.client.VConsole;
import com.vaadin.terminal.gwt.client.ui.layout.CellBasedLayout;
import com.vaadin.terminal.gwt.client.ui.layout.ChildComponentContainer;
@@ -768,7 +769,11 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
allocated += spacingPixelsHorizontal
+ columnWidths[cell.col + i];
}
- if (allocated < width) {
+ if (cell.hasRelativeWidth() && allocated != width) {
+ // This may happen e.g. when browser zoomout causes pixel
+ // rounding issues, see #8619
+ VConsole.error("A relative-width child should never cause cell width to change!");
+ } else if (allocated < width) {
needsLayout = true;
if (cell.colspan == 1) {
// do simple column width expansion
@@ -777,7 +782,7 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
// mark that col span expansion is needed
reDistributeColSpanWidths = true;
}
- } else if (allocated != width) {
+ } else if (allocated > width) {
// size is smaller thant allocated, column might
// shrink
dirtyColumns.add(cell.col);
@@ -790,7 +795,11 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
allocated += spacingPixelsVertical
+ rowHeights[cell.row + i];
}
- if (allocated < height) {
+ if (cell.hasRelativeHeight() && allocated != height) {
+ // This may happen e.g. when browser zoomout causes pixel
+ // rounding issues, see #8619
+ VConsole.error("A relative-height child should never cause cell height to change!");
+ } else if (allocated < height) {
needsLayout = true;
if (cell.rowspan == 1) {
// do simple row expansion
@@ -799,7 +808,7 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
// mark that row span expansion is needed
reDistributeRowSpanHeights = true;
}
- } else if (allocated != height) {
+ } else if (allocated > height) {
// size is smaller than allocated, row might shrink
dirtyRows.add(cell.row);
}