Fixed mouse hot spot coordinate

This commit is contained in:
Elias Naur 2003-10-11 12:56:26 +00:00
parent 43b2d67a71
commit 0fa67c9680
3 changed files with 9 additions and 7 deletions

View file

@ -77,6 +77,7 @@ public class Cursor {
if (!initialized) {
initialize();
}
yHotspot = height - 1 - yHotspot;
assert Mouse.isCreated();
assert width*height*numImages <= images.remaining(): "width*height*numImages > images.remaining()";
assert delays == null || numImages <= delays.remaining(): "delays != null && numImages > delays.remaining()";
@ -84,7 +85,7 @@ public class Cursor {
assert yHotspot < height && yHotspot >= 0: "yHotspot > height || yHotspot < 0";
IntBuffer images_copy = ByteBuffer.allocateDirect(images.remaining()*4).order(ByteOrder.nativeOrder()).asIntBuffer();
flipImages(width, height, numImages, images, images_copy);
nativeHandle = nCreateCursor(width, height, xHotspot, height - yHotspot, numImages, images_copy, 0, delays, delays != null ? delays.position() : 0);
nativeHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, images_copy, 0, delays, delays != null ? delays.position() : 0);
}
private static void initialize() {