#490: Refactorings.

This commit is contained in:
Harald Kuhr 2020-01-09 21:25:41 +01:00
parent 5c1f51f3ca
commit d3249dc3d5
3 changed files with 14 additions and 14 deletions

View File

@ -230,18 +230,14 @@ public final class AdobePathReader {
default:
return new AdobePathSegment(
selector,
toFixedPoint(data.readInt()),
toFixedPoint(data.readInt()),
toFixedPoint(data.readInt()),
toFixedPoint(data.readInt()),
toFixedPoint(data.readInt()),
toFixedPoint(data.readInt())
AdobePathSegment.fromFixedPoint(data.readInt()),
AdobePathSegment.fromFixedPoint(data.readInt()),
AdobePathSegment.fromFixedPoint(data.readInt()),
AdobePathSegment.fromFixedPoint(data.readInt()),
AdobePathSegment.fromFixedPoint(data.readInt()),
AdobePathSegment.fromFixedPoint(data.readInt())
);
}
}
// TODO: Move to AdobePathSegment
private static double toFixedPoint(final int fixed) {
return ((double) fixed / 0x1000000);
}
}

View File

@ -131,6 +131,14 @@ final class AdobePathSegment {
this.cplx = cplx;
}
static int toFixedPoint(final double value) {
return (int) Math.round(value * 0x1000000);
}
static double fromFixedPoint(final int fixed) {
return ((double) fixed / 0x1000000);
}
@Override
public boolean equals(final Object other) {
if (this == other) {

View File

@ -219,8 +219,4 @@ public final class AdobePathWriter {
return bytes.toByteArray();
}
// TODO: Move to AdobePathSegment
private static int toFixedPoint(final double value) {
return (int) Math.round(value * 0x1000000);
}
}