mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 04:25:29 -04:00
#419 PICT rounding issue
This commit is contained in:
parent
a81472bb5f
commit
2078843086
@ -2105,7 +2105,7 @@ public final class PICTImageReader extends ImageReaderBase {
|
|||||||
// Get transfer mode
|
// Get transfer mode
|
||||||
int transferMode = pStream.readUnsignedShort();
|
int transferMode = pStream.readUnsignedShort();
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
System.out.print(", mode: " + transferMode);
|
System.out.println(", mode: " + transferMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up pixel buffer for the RGB values
|
// Set up pixel buffer for the RGB values
|
||||||
@ -2409,7 +2409,7 @@ public final class PICTImageReader extends ImageReaderBase {
|
|||||||
* image resolution ratio.
|
* image resolution ratio.
|
||||||
*/
|
*/
|
||||||
private int getXPtCoord(int pPoint) {
|
private int getXPtCoord(int pPoint) {
|
||||||
return (int) (pPoint / screenImageXRatio);
|
return (int) Math.round(pPoint / screenImageXRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2418,7 +2418,7 @@ public final class PICTImageReader extends ImageReaderBase {
|
|||||||
* image resolution ratio.
|
* image resolution ratio.
|
||||||
*/
|
*/
|
||||||
private int getYPtCoord(int pPoint) {
|
private int getYPtCoord(int pPoint) {
|
||||||
return (int) (pPoint / screenImageYRatio);
|
return (int) Math.round(pPoint / screenImageYRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2480,7 +2480,6 @@ public final class PICTImageReader extends ImageReaderBase {
|
|||||||
// Might need to clear background
|
// Might need to clear background
|
||||||
g.setComposite(AlphaComposite.Src);
|
g.setComposite(AlphaComposite.Src);
|
||||||
g.setColor(new Color(0x00ffffff, true)); // Transparent white
|
g.setColor(new Color(0x00ffffff, true)); // Transparent white
|
||||||
// g.setColor(Color.WHITE);
|
|
||||||
g.fillRect(0, 0, image.getWidth(), image.getHeight());
|
g.fillRect(0, 0, image.getWidth(), image.getHeight());
|
||||||
|
|
||||||
AffineTransform instance = new AffineTransform();
|
AffineTransform instance = new AffineTransform();
|
||||||
@ -2492,12 +2491,7 @@ public final class PICTImageReader extends ImageReaderBase {
|
|||||||
|
|
||||||
instance.scale(screenImageXRatio / subX, screenImageYRatio / subY);
|
instance.scale(screenImageXRatio / subX, screenImageYRatio / subY);
|
||||||
g.setTransform(instance);
|
g.setTransform(instance);
|
||||||
// try {
|
|
||||||
drawOnto(g);
|
drawOnto(g);
|
||||||
// }
|
|
||||||
// catch (IOException e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
g.dispose();
|
g.dispose();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user