Ver código fonte

don't change cursor over/out if canceled event

ncannasse 9 anos atrás
pai
commit
e151aca856
2 arquivos alterados com 8 adições e 4 exclusões
  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;
 		case EOver:
-			hxd.System.setCursor(cursor);
 			onOver(e);
+			if( !e.cancel )
+				hxd.System.setCursor(cursor);
 		case EOut:
 			mouseDownButton = -1;
-			hxd.System.setCursor(Default);
 			onOut(e);
+			if( !e.cancel )
+				hxd.System.setCursor(Default);
 		case EWheel:
 			onWheel(e);
 		case EFocusLost:

+ 4 - 2
h3d/scene/Interactive.hx

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