root.getStyle().setHeight(height + defaultCellBorderBottomSize,
Unit.PX);
- if (!delayRepositioning) {
- // move the visible spacers getRow row onwards.
- shiftSpacerPositionsAfterRow(getRow(), heightDiff);
- }
+ // move the visible spacers getRow row onwards.
+ shiftSpacerPositionsAfterRow(getRow(), heightDiff);
/*
* If we're growing, we'll adjust the scroll size first, then
tBodyScrollTop + moveDiff);
verticalScrollbar.setScrollPosByDelta(moveDiff);
- } else if (!delayRepositioning) {
+ } else {
body.shiftRowPositions(getRow(), heightDiff);
}
/** Width of the spacers' decos. Calculated once then cached. */
private double spacerDecoWidth = 0.0D;
- private boolean delayRepositioning = false;
-
public void setSpacer(int rowIndex, double height)
throws IllegalArgumentException {
void resetSpacer(int rowIndex) {
if (spacerExists(rowIndex)) {
- delayRepositioning = true;
- double oldHeight = getSpacer(rowIndex).getHeight();
- removeSpacer(rowIndex);
- // real height will be determined later
- insertNewSpacer(rowIndex, 0);
- // reposition content below this point to match lack of height,
- // otherwise later repositioning will fail
- if (oldHeight > 0) {
- shiftSpacerPositionsAfterRow(rowIndex, -oldHeight);
- body.shiftRowPositions(rowIndex, -oldHeight);
- }
- delayRepositioning = false;
+ SpacerImpl spacer = getSpacer(rowIndex);
+ destroySpacerContent(spacer);
+ initSpacerContent(spacer);
}
}