فهرست منبع

allow cursor = null to prevent change onOver (when using custom cursor)

ncannasse 8 سال پیش
والد
کامیت
923be9ded7
2فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 2 2
      h2d/Interactive.hx
  2. 2 2
      h3d/scene/Interactive.hx

+ 2 - 2
h2d/Interactive.hx

@@ -142,7 +142,7 @@ class Interactive extends Drawable implements hxd.SceneEvents.Interactive {
 			mouseDownButton = -1;
 		case EOver:
 			onOver(e);
-			if( !e.cancel )
+			if( !e.cancel && cursor != null )
 				hxd.System.setCursor(cursor);
 		case EOut:
 			mouseDownButton = -1;
@@ -166,7 +166,7 @@ class Interactive extends Drawable implements hxd.SceneEvents.Interactive {
 
 	function set_cursor(c) {
 		this.cursor = c;
-		if( isOver() )
+		if( isOver() && cursor != null )
 			hxd.System.setCursor(cursor);
 		return c;
 	}

+ 2 - 2
h3d/scene/Interactive.hx

@@ -77,7 +77,7 @@ class Interactive extends Object implements hxd.SceneEvents.Interactive {
 			mouseDownButton = -1;
 		case EOver:
 			onOver(e);
-			if( !e.cancel )
+			if( !e.cancel && cursor != null )
 				hxd.System.setCursor(cursor);
 		case EOut:
 			mouseDownButton = -1;
@@ -101,7 +101,7 @@ class Interactive extends Object implements hxd.SceneEvents.Interactive {
 
 	function set_cursor(c) {
 		this.cursor = c;
-		if( isOver() )
+		if( isOver() && cursor != null )
 			hxd.System.setCursor(cursor);
 		return c;
 	}