Skip to content

Commit 22fc220

Browse files
deltakoshDavid Catuhe
andauthored
Fix bug when action conditions are not met but cursor is changed (#17414)
Co-authored-by: David Catuhe <david@catuhe.com>
1 parent a69636d commit 22fc220

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/dev/core/src/Actions/action.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ export interface IAction {
6565
* @see https://www.babylonjs-playground.com/#1T30HR#0
6666
*/
6767
then(action: IAction): IAction;
68+
69+
/**
70+
* Internal only - Returns if the current condition allows to run the action
71+
* @internal
72+
*/
73+
_evaluateConditionForCurrentFrame(): boolean;
6874
}
6975

7076
/**

packages/dev/core/src/Actions/actionManager.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ export class ActionManager extends AbstractActionManager {
245245
const action = this.actions[index];
246246

247247
if (action.trigger >= ActionManager.OnPickTrigger && action.trigger <= ActionManager.OnPointerOutTrigger) {
248-
return true;
248+
if (action._evaluateConditionForCurrentFrame()) {
249+
return true;
250+
}
249251
}
250252
}
251253

@@ -260,7 +262,9 @@ export class ActionManager extends AbstractActionManager {
260262
const action = this.actions[index];
261263

262264
if (action.trigger >= ActionManager.OnPickTrigger && action.trigger <= ActionManager.OnPickUpTrigger) {
263-
return true;
265+
if (action._evaluateConditionForCurrentFrame()) {
266+
return true;
267+
}
264268
}
265269
}
266270

0 commit comments

Comments
 (0)