mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 04:25:29 -04:00
#490: Refactorings.
This commit is contained in:
parent
5c1f51f3ca
commit
d3249dc3d5
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user