@awayjs/scene 0.13.325 → 0.13.326

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- console.debug('AwayJS - Scene - 0.13.325');
1
+ console.debug('AwayJS - Scene - 0.13.326');
2
2
  export { Timeline } from './lib/base/Timeline';
3
3
  export { ControllerBase } from './lib/controllers/ControllerBase';
4
4
  export { FirstPersonController } from './lib/controllers/FirstPersonController';
@@ -178,17 +178,17 @@ var MouseManager = /** @class */ (function () {
178
178
  return;
179
179
  }
180
180
  var target = dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.container;
181
- while (dispatcher) {
182
- if (event.commonAncestor && dispatcher == event.commonAncestor) {
183
- return;
184
- }
185
- event._dispatchEvent(dispatcher, target);
186
- if (!event._iAllowedToPropagate) {
187
- dispatcher = null;
188
- }
189
- else {
190
- dispatcher = dispatcher.parent;
191
- }
181
+ var path = [];
182
+ for (var node = dispatcher; node; node = node.parent) {
183
+ if (event.commonAncestor && node == event.commonAncestor)
184
+ break;
185
+ path.push(node);
186
+ }
187
+ for (var _i = 0, path_1 = path; _i < path_1.length; _i++) {
188
+ var node = path_1[_i];
189
+ event._dispatchEvent(node, target);
190
+ if (!event._iAllowedToPropagate)
191
+ break;
192
192
  }
193
193
  };
194
194
  MouseManager.prototype.setupAndDispatchEvent = function (event, pointerData, collision, commonAncestor) {
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- console.debug('AwayJS - Scene - 0.13.325');
1
+ console.debug('AwayJS - Scene - 0.13.326');
2
2
 
3
3
  export { IDisplayObjectAdapter } from './lib/adapters/IDisplayObjectAdapter';
4
4
  export { IMovieClipAdapter } from './lib/adapters/IMovieClipAdapter';
@@ -250,18 +250,18 @@ export class MouseManager {
250
250
  }
251
251
 
252
252
  const target = dispatcher?.container;
253
+ const path: INode[] = [];
253
254
 
254
- while (dispatcher) {
255
- if (event.commonAncestor && dispatcher == event.commonAncestor) {
256
- return;
257
- }
258
- event._dispatchEvent(dispatcher, target);
255
+ for (let node: INode | undefined = dispatcher; node; node = node.parent) {
256
+ if (event.commonAncestor && node == event.commonAncestor)
257
+ break;
258
+ path.push(node);
259
+ }
259
260
 
260
- if (!event._iAllowedToPropagate) {
261
- dispatcher = null;
262
- } else {
263
- dispatcher = dispatcher.parent;
264
- }
261
+ for (const node of path) {
262
+ event._dispatchEvent(node, target);
263
+ if (!event._iAllowedToPropagate)
264
+ break;
265
265
  }
266
266
  }
267
267
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awayjs/scene",
3
- "version": "0.13.325",
3
+ "version": "0.13.326",
4
4
  "description": "AwayJS scene classes",
5
5
  "main": "bundle/awayjs-scene.umd.js",
6
6
  "module": "dist/index.js",