applyColumnWidths();
} else {
applyColumnWidthsWithExpansion();
+
+ /*
+ * [[subpixelworkaround]] (6.2.2015, Henrik Paul) FIXME: just
+ * dump all the remaining pixels into the last column and
+ * whistle loudly
+ */
+ boolean dumpIntoLastColumn = false;
+ double escalatorWidth = escalator.getInnerWidth();
+ double occupiedWidth = 0;
+ for (Column column : getColumns()) {
+ occupiedWidth += column.getWidthActual();
+ if (column.getWidth() < 0 && column.getExpandRatio() != 0) {
+ dumpIntoLastColumn = true;
+ }
+ }
+
+ if (dumpIntoLastColumn) {
+ Column<?, T> lastColumn = getColumn(getColumnCount() - 1);
+ double width = Math.floor(lastColumn.getWidthActual()
+ + (escalatorWidth - occupiedWidth));
+ escalator.getColumnConfiguration().setColumnWidth(
+ getColumnCount() - 1, width);
+ }
}
}
* can distribute the remaining pixels to all columns according to
* their expand ratios.
*/
- double pixelsToDistribute = escalator.getInnerWidth()
+ // [[subpixelworkaround]] (6.2.2015, Henrik Paul) FIXME: ceil
+ double pixelsToDistribute = Math.ceil(escalator.getInnerWidth())
- reservedPixels;
if (pixelsToDistribute <= 0 || totalRatios <= 0) {
return;
boolean aColumnHasMaxedOut;
do {
aColumnHasMaxedOut = false;
- final double widthPerRatio = pixelsToDistribute / totalRatios;
+ // [[subpixelworkaround]] (6.2.2015, Henrik Paul) FIXME floor
+ final double widthPerRatio = Math.floor(pixelsToDistribute
+ / totalRatios);
final Iterator<Column<?, ?>> i = columnsToExpand.iterator();
while (i.hasNext()) {
final Column<?, ?> column = i.next();
* If we still have anything left, distribute the remaining pixels
* to the remaining columns.
*/
- final double widthPerRatio = pixelsToDistribute / totalRatios;
+ // [[subpixelworkaround]] (6.2.2015, Henrik Paul) FIXME: floor
+ final double widthPerRatio = Math.floor(pixelsToDistribute
+ / totalRatios);
for (Column<?, ?> column : columnsToExpand) {
final int expandRatio = getExpandRatio(column,
someColumnExpands);
* wouldn't show up in that set.
*/
- double minWidth = getMinWidth(column);
+ // [[subpixelworkaround]] (6.2.2015, Henrik Paul) FIXME ceil
+ double minWidth = Math.ceil(getMinWidth(column));
double currentWidth = column.getWidthActual();
boolean hasAutoWidth = column.getWidth() < 0;
if (hasAutoWidth && currentWidth < minWidth) {
for (Column<?, ?> column : columnsToExpand) {
totalRatios += getExpandRatio(column, someColumnExpands);
}
- final double pixelsToRemovePerRatio = pixelsToRemoveFromOtherColumns
- / totalRatios;
+ // [[subpixelworkaround]] (6.2.2015, Henrik Paul) FIXME: ceil
+ final double pixelsToRemovePerRatio = Math
+ .ceil(pixelsToRemoveFromOtherColumns / totalRatios);
for (Column<?, ?> column : columnsToExpand) {
final double pixelsToRemove = pixelsToRemovePerRatio
* getExpandRatio(column, someColumnExpands);
* the width in pixels or negative for auto sizing
*/
public Column<C, T> setWidth(double pixels) {
- if (widthUser != pixels) {
+ if (!WidgetUtil.pixelValuesEqual(widthUser, pixels)) {
widthUser = pixels;
scheduleColumnWidthRecalculator();
}