Skip to content

Commit 27553b3

Browse files
committed
fix FixedPointNumberType max range
1 parent 6821b70 commit 27553b3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/de/srendi/advancedperipherals/common/smartglasses/modules/overlay/propertytypes/FixedPointNumberType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public Number fixValue(Number value) {
4242
return Math.min(Math.max(valueb.byteValue(), (byte) Math.max(min, Byte.MIN_VALUE)), (byte) Math.min(max, Byte.MAX_VALUE));
4343
}
4444
if (value instanceof Short values) {
45-
return Math.min(Math.max(values.shortValue(), (short) Math.max(min, Short.MIN_VALUE)), (short) Math.max(max, Short.MAX_VALUE));
45+
return Math.min(Math.max(values.shortValue(), (short) Math.max(min, Short.MIN_VALUE)), (short) Math.min(max, Short.MAX_VALUE));
4646
}
4747
if (value instanceof Integer valuei) {
48-
return Math.min(Math.max(valuei.intValue(), (int) Math.max(min, Integer.MIN_VALUE)), (int) Math.max(max, Integer.MAX_VALUE));
48+
return Math.min(Math.max(valuei.intValue(), (int) Math.max(min, Integer.MIN_VALUE)), (int) Math.min(max, Integer.MAX_VALUE));
4949
}
5050
return Math.min(Math.max(value.longValue(), min), max);
5151
}

0 commit comments

Comments
 (0)