mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-10-03 23:53:15 -04:00
#490: Refactorings.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user