@awayjs/scene 0.13.254 → 0.13.255

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.
@@ -11363,7 +11363,6 @@ var TextField = /** @class */ (function (_super) {
11363
11363
  this.maskChild.visible = false;
11364
11364
  this._graphics.clear();
11365
11365
  this.targetGraphics = this.textChild.graphics;
11366
- return;
11367
11366
  }
11368
11367
  // only use masking if needed:
11369
11368
  if (this._textWidth > this._width || this._textHeight > this._height) {
@@ -11665,9 +11664,23 @@ var TextField = /** @class */ (function (_super) {
11665
11664
  this.scrollToCursor(startx + width, oldy + height);
11666
11665
  };
11667
11666
  TextField.prototype.drawBG = function () {
11668
- this._graphics.beginFill(this.backgroundColor, (!this._background) ? 0 : 1);
11669
- this._graphics.drawRect(this.textOffsetX, this.textOffsetY, this.width, this.height);
11670
- this._graphics.endFill();
11667
+ //TODO this fixes masking using static textfields, but dynamic textfields still have problems. (see addChild(this.maskChild))
11668
+ if (this._background) {
11669
+ this._graphics.beginFill(this.backgroundColor, 1);
11670
+ this._graphics.drawRect(this.textOffsetX, this.textOffsetY, this.width, this.height);
11671
+ this._graphics.endFill();
11672
+ }
11673
+ //create a hitArea for the textfield
11674
+ var pickObject = this.pickObject;
11675
+ if (!pickObject) {
11676
+ this.pickObject = pickObject || (pickObject = new Sprite());
11677
+ pickObject.pickObjectFromTimeline = true;
11678
+ }
11679
+ var graphics = pickObject.graphics;
11680
+ graphics.clear();
11681
+ graphics.beginFill(0x000000, 1);
11682
+ graphics.drawRect(this.textOffsetX, this.textOffsetY, this.width, this.height);
11683
+ graphics.endFill();
11671
11684
  };
11672
11685
  TextField.prototype.drawBorder = function () {
11673
11686
  var half_thickness_x = this.border ? 0.25 * this.internalScale.x : 0;
@@ -18178,7 +18191,7 @@ var Scene = /** @class */ (function () {
18178
18191
  _awayjs_graphics.MaterialManager.materialClass = _awayjs_materials.MethodMaterial;
18179
18192
  _awayjs_graphics.MaterialManager.textureClass = _awayjs_renderer.ImageTexture2D;
18180
18193
 
18181
- console.debug('AwayJS - Scene - 0.13.254');
18194
+ console.debug('AwayJS - Scene - 0.13.255');
18182
18195
 
18183
18196
  exports.Timeline = Timeline;
18184
18197
  exports.ControllerBase = ControllerBase;