@awayjs/scene 0.13.236 → 0.13.239

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.
@@ -6654,7 +6654,7 @@ var FrameScriptManager = /** @class */ (function () {
6654
6654
  * after that execute_as3_constructors_finish_scene is called for the scene-mc
6655
6655
  * so that we can continue with the next top-level child that has not yet been processed
6656
6656
  */
6657
- for (var i = 0; i < mc.numChildren; i++) {
6657
+ for (var i = 0, l = mc.numChildren; i < l; i++) {
6658
6658
  var child = mc.getChildAt(i);
6659
6659
  if (child.parent && child.adapter.executeConstructor)
6660
6660
  FrameScriptManager.execute_as3_constructors_recursiv(child);
@@ -6732,11 +6732,12 @@ var FrameScriptManager = /** @class */ (function () {
6732
6732
  }
6733
6733
  else {
6734
6734
  // constructor already has run. we need to still do recursion on childs
6735
- for (var i = 0; i < mc.numChildren; i++) {
6735
+ for (var i = 0, l = mc.numChildren; i < l; i++) {
6736
6736
  var child = mc.getChildAt(i);
6737
- if (child.parent) {
6738
- FrameScriptManager.execute_as3_constructors_recursiv(child);
6739
- }
6737
+ // because we iterate over mc, it already is parent
6738
+ //if (child.parent) {
6739
+ FrameScriptManager.execute_as3_constructors_recursiv(child);
6740
+ //}
6740
6741
  }
6741
6742
  }
6742
6743
  // if mc was created by timeline, instanceID != ""
@@ -13461,7 +13462,7 @@ var TextField = /** @class */ (function (_super) {
13461
13462
  textShape.elements.invalidate();
13462
13463
  textShape.shape = _awayjs_graphics.Shape.getShape(textShape.elements);
13463
13464
  // has BUG for QWOP, temporarily enable it (default)
13464
- textShape.shape.deepHitCheck = false;
13465
+ textShape.shape.deepHitCheck = true;
13465
13466
  textShape.shape.usages++;
13466
13467
  var sampler = new _awayjs_stage.ImageSampler(false, true, true);
13467
13468
  textShape.shape.style = new _awayjs_renderer.Style();
@@ -15061,20 +15062,22 @@ var SceneImage2D = /** @class */ (function (_super) {
15061
15062
  !internal); // and not internal
15062
15063
  // target image for rendering.
15063
15064
  var target = this;
15065
+ // we should run compositor when blendMode !== LAYER (default)
15066
+ // or when we use MSAA + fill is not flat.
15067
+ var useBlend = blendMode !== _awayjs_stage.BlendMode.LAYER || this._lastUsedFill === null;
15068
+ var useTemp = useBlend || nativeMSAA;
15064
15069
  // lazy filling
15065
15070
  // we require fill image with initial color, because we not doing this immediate
15066
- if (!nativeMSAA && this._initalFillColor !== null) {
15071
+ // and when blend is required, because we should blend with vald color
15072
+ if ((!nativeMSAA || useBlend) && this._initalFillColor !== null) {
15067
15073
  this.fillRect(this._rect, this._initalFillColor);
15068
15074
  this._initalFillColor = null;
15069
15075
  }
15070
- // we should run compositor when blendMode !== LAYER (default)
15071
- // or when we use MSAA + fill is not flat.
15072
- var useBlend = blendMode !== _awayjs_stage.BlendMode.LAYER || this._lastUsedFill === null;
15073
- var useTemp = useBlend || nativeMSAA;
15074
15076
  if (useTemp) {
15075
15077
  target = SceneImage2D.getTemp(this.width, this.height, this._stage, nativeMSAA);
15076
15078
  // because target image is stupid filled - it not require merging
15077
- if (this._lastUsedFill !== null) {
15079
+ // BUT when blend is required - we shpuld skip color clear and use empty TMP
15080
+ if (!useBlend && this._lastUsedFill !== null) {
15078
15081
  // bitmap was filled plain, go clear TMP to this color too
15079
15082
  renderer.disableClear = false;
15080
15083
  renderer.view.backgroundColor = this._lastUsedFill;
@@ -15794,7 +15797,16 @@ var MouseManager = /** @class */ (function () {
15794
15797
  !MouseManager.inputRecorder || MouseManager.inputRecorder.recordEvent(event);
15795
15798
  //console.log("Keydown", event);
15796
15799
  if (this.allowKeyInput) {
15797
- //event.preventDefault();
15800
+ switch (event.keyCode) {
15801
+ case 37: // left
15802
+ case 39: // right
15803
+ case 38: // up
15804
+ case 40: // down
15805
+ event.preventDefault();
15806
+ break;
15807
+ default:
15808
+ break;
15809
+ }
15798
15810
  if (this._focusContainer || this._stage) {
15799
15811
  //console.log("dispatch keydown on ", this._focusContainer);
15800
15812
  var newEvent = new KeyboardEvent(KeyboardEvent.KEYDOWN, event.key, event.code);
@@ -15813,7 +15825,16 @@ var MouseManager = /** @class */ (function () {
15813
15825
  !MouseManager.inputRecorder || MouseManager.inputRecorder.recordEvent(event);
15814
15826
  //console.log("Keyup", event);
15815
15827
  if (this.allowKeyInput) {
15816
- //event.preventDefault();
15828
+ switch (event.keyCode) {
15829
+ case 37: // left
15830
+ case 39: // right
15831
+ case 38: // up
15832
+ case 40: // down
15833
+ event.preventDefault();
15834
+ break;
15835
+ default:
15836
+ break;
15837
+ }
15817
15838
  if (this._focusContainer || this._stage) {
15818
15839
  //console.log("dispatch keydown on ", this._focusContainer);
15819
15840
  var newEvent = new KeyboardEvent(KeyboardEvent.KEYUP, event.key, event.code);
@@ -18372,7 +18393,7 @@ var Scene = /** @class */ (function () {
18372
18393
  _awayjs_graphics.MaterialManager.materialClass = _awayjs_materials.MethodMaterial;
18373
18394
  _awayjs_graphics.MaterialManager.textureClass = _awayjs_renderer.ImageTexture2D;
18374
18395
 
18375
- console.debug('AwayJS - Scene - 0.13.236');
18396
+ console.debug('AwayJS - Scene - 0.13.239');
18376
18397
 
18377
18398
  exports.Timeline = Timeline;
18378
18399
  exports.ControllerBase = ControllerBase;