Jelajahi Sumber

don't change cursor over/out if canceled event

ncannasse 9 tahun lalu
induk
melakukan
e151aca856
2 mengubah file dengan 8 tambahan dan 4 penghapusan
  1. 4 2
      h2d/Interactive.hx
  2. 4 2
      h3d/scene/Interactive.hx

+ 4 - 2
h2d/Interactive.hx

@@ -149,12 +149,14 @@ class Interactive extends Drawable implements hxd.SceneEvents.Interactive {
 			}
 			}
 			mouseDownButton = -1;
 			mouseDownButton = -1;
 		case EOver:
 		case EOver:
-			hxd.System.setCursor(cursor);
 			onOver(e);
 			onOver(e);
+			if( !e.cancel )
+				hxd.System.setCursor(cursor);
 		case EOut:
 		case EOut:
 			mouseDownButton = -1;
 			mouseDownButton = -1;
-			hxd.System.setCursor(Default);
 			onOut(e);
 			onOut(e);
+			if( !e.cancel )
+				hxd.System.setCursor(Default);
 		case EWheel:
 		case EWheel:
 			onWheel(e);
 			onWheel(e);
 		case EFocusLost:
 		case EFocusLost:

+ 4 - 2
h3d/scene/Interactive.hx

@@ -76,12 +76,14 @@ class Interactive extends Object implements hxd.SceneEvents.Interactive {
 			}
 			}
 			mouseDownButton = -1;
 			mouseDownButton = -1;
 		case EOver:
 		case EOver:
-			hxd.System.setCursor(cursor);
 			onOver(e);
 			onOver(e);
+			if( !e.cancel )
+				hxd.System.setCursor(cursor);
 		case EOut:
 		case EOut:
 			mouseDownButton = -1;
 			mouseDownButton = -1;
-			hxd.System.setCursor(Default);
 			onOut(e);
 			onOut(e);
+			if( !e.cancel )
+				hxd.System.setCursor(Default);
 		case EWheel:
 		case EWheel:
 			onWheel(e);
 			onWheel(e);
 		case EFocusLost:
 		case EFocusLost: