mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 20:45:29 -04:00
#490: Refactorings.
This commit is contained in:
parent
5c1f51f3ca
commit
d3249dc3d5
@ -230,18 +230,14 @@ public final class AdobePathReader {
|
|||||||
default:
|
default:
|
||||||
return new AdobePathSegment(
|
return new AdobePathSegment(
|
||||||
selector,
|
selector,
|
||||||
toFixedPoint(data.readInt()),
|
AdobePathSegment.fromFixedPoint(data.readInt()),
|
||||||
toFixedPoint(data.readInt()),
|
AdobePathSegment.fromFixedPoint(data.readInt()),
|
||||||
toFixedPoint(data.readInt()),
|
AdobePathSegment.fromFixedPoint(data.readInt()),
|
||||||
toFixedPoint(data.readInt()),
|
AdobePathSegment.fromFixedPoint(data.readInt()),
|
||||||
toFixedPoint(data.readInt()),
|
AdobePathSegment.fromFixedPoint(data.readInt()),
|
||||||
toFixedPoint(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;
|
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
|
@Override
|
||||||
public boolean equals(final Object other) {
|
public boolean equals(final Object other) {
|
||||||
if (this == other) {
|
if (this == other) {
|
||||||
|
@ -219,8 +219,4 @@ public final class AdobePathWriter {
|
|||||||
return bytes.toByteArray();
|
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