if (alignment.isHorizontalCenter()) {
currentLocation += (allocatedSpace - usedWidth) / 2d;
if (captionAboveCompnent) {
- captionStyle.setLeft((usedWidth - captionWidth) / 2,
- Unit.PX);
+ captionStyle.setLeft(
+ Math.round(usedWidth - captionWidth) / 2, Unit.PX);
}
} else {
currentLocation += (allocatedSpace - usedWidth);
if (captionAboveCompnent) {
- captionStyle.setLeft(usedWidth - captionWidth, Unit.PX);
+ captionStyle.setLeft(Math.round(usedWidth - captionWidth),
+ Unit.PX);
}
}
} else {
}
}
- style.setLeft(currentLocation, Unit.PX);
+ style.setLeft(Math.round(currentLocation), Unit.PX);
}
private double parsePercent(String size) {