We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0191147 commit 104c995Copy full SHA for 104c995
src/Project.ts
@@ -137,7 +137,9 @@ export default class Project {
137
triggerMatches: (tr: Trigger, target: Sprite | Stage) => boolean
138
): TriggerWithTarget[] {
139
const matchingTriggers: TriggerWithTarget[] = [];
140
- for (const target of this.targets) {
+ // Iterate over targets in top-down order, as Scratch does
141
+ for (let i = this.targets.length - 1; i >= 0; i--) {
142
+ const target = this.targets[i];
143
const matchingTargetTriggers = target.triggers.filter((tr) =>
144
triggerMatches(tr, target)
145
);
0 commit comments