@Override
public void setHeight(String height) {
if (height.endsWith("px")) {
- int h = Integer.parseInt(height.substring(0, height.length() - 2));
+ float h = Float
+ .parseFloat(height.substring(0, height.length() - 2));
h -= getExtraVerticalPixels();
if (h < 0) {
h = 0;
@Override
public void setWidth(String width) {
if (width.endsWith("px")) {
- int w = Integer.parseInt(width.substring(0, width.length() - 2));
+ float w = Float.parseFloat(width.substring(0, width.length() - 2));
w -= getExtraHorizontalPixels();
if (w < 0) {
w = 0;
* @return CSS height
*/
private String getCSSHeight() {
- if (getHeightUnits() == Unit.PIXELS) {
- return ((int) getHeight()) + getHeightUnits().getSymbol();
- } else {
- return getHeight() + getHeightUnits().getSymbol();
- }
+ return getHeight() + getHeightUnits().getSymbol();
}
/**
* @return CSS width
*/
private String getCSSWidth() {
- if (getWidthUnits() == Unit.PIXELS) {
- return ((int) getWidth()) + getWidthUnits().getSymbol();
- } else {
- return getWidth() + getWidthUnits().getSymbol();
- }
+ return getWidth() + getWidthUnits().getSymbol();
}
/**