浏览代码

don't change cursor over/out if canceled event

ncannasse 9 年之前
父节点
当前提交
e151aca856
共有 2 个文件被更改,包括 8 次插入4 次删除
  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: