diff options
4 files changed, 10 insertions, 6 deletions
diff --git a/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseManager.java b/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseManager.java index 194b729..9f5a816 100644 --- a/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseManager.java +++ b/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseManager.java @@ -62,7 +62,7 @@ public class AwtMouseManager implements MouseManager { } public void setCursor(final MouseCursor cursor) { - if (cursor == MouseCursor.SYSTEM_DEFAULT) { + if (cursor == MouseCursor.SYSTEM_DEFAULT || cursor == null) { if (_grabbedState == GrabbedState.GRABBED) { _pregrabCursor = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR); } else { diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtMouseManager.java b/ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtMouseManager.java index 10ca249..ae5692f 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtMouseManager.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/input/jogl/JoglNewtMouseManager.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ @@ -45,6 +45,10 @@ public class JoglNewtMouseManager implements MouseManager { } private PointerIcon createJoglCursor(final MouseCursor cursor) { + if (cursor == MouseCursor.SYSTEM_DEFAULT || cursor == null) { + return null; // setting the cursor to null in JOGL means using the system default one + } + final Image image = cursor.getImage(); final DimensionImmutable size = new Dimension(image.getWidth(), image.getHeight()); final ByteBuffer pixels = image.getData(0); diff --git a/ardor3d-lwjgl/src/main/java/com/ardor3d/input/lwjgl/LwjglMouseManager.java b/ardor3d-lwjgl/src/main/java/com/ardor3d/input/lwjgl/LwjglMouseManager.java index b689841..0b2a64a 100644 --- a/ardor3d-lwjgl/src/main/java/com/ardor3d/input/lwjgl/LwjglMouseManager.java +++ b/ardor3d-lwjgl/src/main/java/com/ardor3d/input/lwjgl/LwjglMouseManager.java @@ -63,7 +63,7 @@ public class LwjglMouseManager implements MouseManager { } private Cursor createLwjglCursor(final MouseCursor cursor) throws LWJGLException { - if (cursor == MouseCursor.SYSTEM_DEFAULT) { + if (cursor == MouseCursor.SYSTEM_DEFAULT || cursor == null) { return null; // setting the cursor to null in LWJGL means using the system default one } diff --git a/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtMouseManager.java b/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtMouseManager.java index 8918263..012766d 100644 --- a/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtMouseManager.java +++ b/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtMouseManager.java @@ -49,15 +49,15 @@ public class SwtMouseManager implements MouseManager { } public void setCursor(final MouseCursor cursor) { - if (cursor == MouseCursor.SYSTEM_DEFAULT) { + if (cursor == MouseCursor.SYSTEM_DEFAULT || cursor == null) { _control.setCursor(null); return; } final ImageData imageData = SWTImageUtil.convertToSWT(cursor.getImage()).get(0); - final Cursor swtCursor = new Cursor(_control.getDisplay(), imageData, cursor.getHotspotX(), cursor - .getHotspotY()); + final Cursor swtCursor = new Cursor(_control.getDisplay(), imageData, cursor.getHotspotX(), + cursor.getHotspotY()); _control.setCursor(swtCursor); } |