Skip to content

Commit 45a41aa

Browse files
committed
Replace float unboxing with casting.
DEVSIX-1368
1 parent 35ff293 commit 45a41aa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

layout/src/main/java/com/itextpdf/layout/renderer/RotationUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static MinMaxWidth countRotationMinMaxWidth(MinMaxWidth minMaxWidth, Abst
7373
PropertiesBackup backup = new PropertiesBackup(renderer);
7474
Float rotation = backup.storeFloatProperty(Property.ROTATION_ANGLE);
7575
if (rotation != null) {
76-
float angle = rotation.floatValue();
76+
float angle = (float) rotation;
7777
//This width results in more accurate values for min-width calculations.
7878
float layoutWidth = minMaxWidth.getMaxWidth() + MinMaxWidthUtils.getEps();
7979
LayoutResult layoutResult = renderer.layout(new LayoutContext(new LayoutArea(1, new Rectangle(layoutWidth, AbstractRenderer.INF))));
@@ -89,15 +89,15 @@ public static MinMaxWidth countRotationMinMaxWidth(MinMaxWidth minMaxWidth, Abst
8989
Float rotatedMinWidth = getLayoutRotatedWidth(renderer, (float) rotationMinMaxWidth.getMinWidthOrigin(), layoutBBox, angle);
9090
if (rotatedMinWidth != null) {
9191
if (rotatedMinWidth > rotationMinMaxWidth.getMaxWidth()) {
92-
rotationMinMaxWidth.setChildrenMinWidth(rotatedMinWidth.floatValue());
92+
rotationMinMaxWidth.setChildrenMinWidth((float) rotatedMinWidth);
9393
Float rotatedMaxWidth = getLayoutRotatedWidth(renderer, (float) rotationMinMaxWidth.getMaxWidthOrigin(), layoutBBox, angle);
9494
if (rotatedMaxWidth != null && rotatedMaxWidth > rotatedMinWidth) {
95-
rotationMinMaxWidth.setChildrenMaxWidth(rotatedMaxWidth.floatValue());
95+
rotationMinMaxWidth.setChildrenMaxWidth((float) rotatedMaxWidth);
9696
} else {
97-
rotationMinMaxWidth.setChildrenMaxWidth(rotatedMinWidth.floatValue());
97+
rotationMinMaxWidth.setChildrenMaxWidth((float) rotatedMinWidth);
9898
}
9999
} else {
100-
rotationMinMaxWidth.setChildrenMinWidth(rotatedMinWidth.floatValue());
100+
rotationMinMaxWidth.setChildrenMinWidth((float) rotatedMinWidth);
101101
}
102102
backup.restoreProperty(Property.ROTATION_ANGLE);
103103
return rotationMinMaxWidth;
@@ -123,7 +123,7 @@ public static Float retrieveRotatedLayoutWidth(float availableWidth, AbstractRen
123123
PropertiesBackup backup = new PropertiesBackup(renderer);
124124
Float rotation = backup.storeFloatProperty(Property.ROTATION_ANGLE);
125125
if (rotation != null && renderer.<UnitValue>getProperty(Property.WIDTH) == null) {
126-
float angle = rotation.floatValue();
126+
float angle = (float) rotation;
127127
backup.storeFloatProperty(Property.HEIGHT);
128128
backup.storeFloatProperty(Property.MIN_HEIGHT);
129129
backup.storeFloatProperty(Property.MAX_HEIGHT);

0 commit comments

Comments
 (0)