ConstantSize (final FormSpec rowSpec, final RadContainer container, final int newPx) { if (rowSpec.getSize() instanceof ConstantSize oldSize) { int oldPx = oldSize.getPixelSize(container.getDelegee()); double newValue = Math.round(oldSize.getValue() * newPx / oldPx * 10) / 10; return new ConstantSize(newValue, oldSize.getUnit()); } return new ConstantSize(newPx, ConstantSize.PIXEL); }