babylonjs-gui 5.40.1 → 5.41.0

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/babylon.gui.d.ts CHANGED
@@ -980,7 +980,7 @@ declare module BABYLON.GUI {
980
980
  /** @internal */
981
981
  _prevCurrentMeasureTransformedIntoGlobalSpace: Measure;
982
982
  /** @internal */
983
- protected _cachedParentMeasure: Measure;
983
+ _cachedParentMeasure: Measure;
984
984
  private _descendantsOnlyPadding;
985
985
  private _paddingLeft;
986
986
  private _paddingRight;
@@ -1564,7 +1564,7 @@ declare module BABYLON.GUI {
1564
1564
  /** @internal */
1565
1565
  protected _computeAdditionnalOffsetY(): number;
1566
1566
  /** @internal */
1567
- protected invalidateRect(): void;
1567
+ invalidateRect(): void;
1568
1568
  /**
1569
1569
  * @internal
1570
1570
  */
@@ -2527,14 +2527,13 @@ declare module BABYLON.GUI {
2527
2527
  * @internal
2528
2528
  */
2529
2529
  protected _preMeasure(parentMeasure: Measure, context: BABYLON.ICanvasRenderingContext): void;
2530
+ private _computeScroll;
2530
2531
  /**
2531
2532
  * Processing of child after the parent measurement update
2532
2533
  *
2533
- * @param parentMeasure The parent measure
2534
- * @param context The rendering canvas
2535
2534
  * @internal
2536
2535
  */
2537
- protected _additionalProcessing(parentMeasure: Measure, context: BABYLON.ICanvasRenderingContext): void;
2536
+ protected _additionalProcessing(): void;
2538
2537
  private _drawText;
2539
2538
  /**
2540
2539
  * Copy the text in the clipboard
@@ -2590,10 +2589,14 @@ declare module BABYLON.GUI {
2590
2589
  export class Line extends Control {
2591
2590
  name?: string | undefined;
2592
2591
  private _lineWidth;
2593
- private _x1;
2594
- private _y1;
2595
- private _x2;
2596
- private _y2;
2592
+ /** @internal */
2593
+ _x1: ValueAndUnit;
2594
+ /** @internal */
2595
+ _y1: ValueAndUnit;
2596
+ /** @internal */
2597
+ _x2: ValueAndUnit;
2598
+ /** @internal */
2599
+ _y2: ValueAndUnit;
2597
2600
  private _dash;
2598
2601
  private _connectedControl;
2599
2602
  private _connectedControlDirtyObserver;
@@ -2622,8 +2625,10 @@ declare module BABYLON.GUI {
2622
2625
  set horizontalAlignment(value: number);
2623
2626
  /** Gets or sets vertical alignment */
2624
2627
  set verticalAlignment(value: number);
2625
- private get _effectiveX2();
2626
- private get _effectiveY2();
2628
+ /** @internal */
2629
+ get _effectiveX2(): number;
2630
+ /** @internal */
2631
+ get _effectiveY2(): number;
2627
2632
  /**
2628
2633
  * Creates a new Line
2629
2634
  * @param name defines the control name
package/babylon.gui.js CHANGED
@@ -1191,8 +1191,12 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
1191
1191
  return "continue";
1192
1192
  }
1193
1193
  control.notRenderable = false;
1194
+ if (this_1.useInvalidateRectOptimization) {
1195
+ control.invalidateRect();
1196
+ }
1194
1197
  control._moveToProjectedPosition(projectedPosition);
1195
1198
  };
1199
+ var this_1 = this;
1196
1200
  for (var _i = 0, _a = this._linkedControls; _i < _a.length; _i++) {
1197
1201
  var control = _a[_i];
1198
1202
  _loop_1(control);
@@ -10702,17 +10706,9 @@ var InputTextArea = /** @class */ (function (_super) {
10702
10706
  }
10703
10707
  }
10704
10708
  };
10705
- /**
10706
- * Processing of child after the parent measurement update
10707
- *
10708
- * @param parentMeasure The parent measure
10709
- * @param context The rendering canvas
10710
- * @internal
10711
- */
10712
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
10713
- InputTextArea.prototype._additionalProcessing = function (parentMeasure, context) {
10714
- this._clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, parentMeasure.width);
10715
- this._clipTextTop = this._currentMeasure.top + this._margin.getValueInPixel(this._host, parentMeasure.height);
10709
+ InputTextArea.prototype._computeScroll = function () {
10710
+ this._clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width);
10711
+ this._clipTextTop = this._currentMeasure.top + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.height);
10716
10712
  if (this._isFocused && this._lines[this._cursorInfo.currentLineIndex].width > this._availableWidth) {
10717
10713
  var textLeft = this._clipTextLeft - this._lines[this._cursorInfo.currentLineIndex].width + this._availableWidth;
10718
10714
  if (!this._scrollLeft) {
@@ -10732,6 +10728,13 @@ var InputTextArea = /** @class */ (function (_super) {
10732
10728
  else {
10733
10729
  this._scrollTop = this._clipTextTop;
10734
10730
  }
10731
+ };
10732
+ /**
10733
+ * Processing of child after the parent measurement update
10734
+ *
10735
+ * @internal
10736
+ */
10737
+ InputTextArea.prototype._additionalProcessing = function () {
10735
10738
  // Flush the highlighted text each frame
10736
10739
  this.highlightedText = "";
10737
10740
  this.onLinesReadyObservable.notifyObservers(this);
@@ -10819,6 +10822,7 @@ var InputTextArea = /** @class */ (function (_super) {
10819
10822
  };
10820
10823
  InputTextArea.prototype._draw = function (context) {
10821
10824
  var _a, _b;
10825
+ this._computeScroll();
10822
10826
  this._scrollLeft = (_a = this._scrollLeft) !== null && _a !== void 0 ? _a : 0;
10823
10827
  this._scrollTop = (_b = this._scrollTop) !== null && _b !== void 0 ? _b : 0;
10824
10828
  context.save();
@@ -11221,9 +11225,13 @@ var Line = /** @class */ (function (_super) {
11221
11225
  var _this = _super.call(this, name) || this;
11222
11226
  _this.name = name;
11223
11227
  _this._lineWidth = 1;
11228
+ /** @internal */
11224
11229
  _this._x1 = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(0);
11230
+ /** @internal */
11225
11231
  _this._y1 = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(0);
11232
+ /** @internal */
11226
11233
  _this._x2 = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(0);
11234
+ /** @internal */
11227
11235
  _this._y2 = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(0);
11228
11236
  _this._dash = new Array();
11229
11237
  _this._automaticSize = true;
@@ -11366,6 +11374,7 @@ var Line = /** @class */ (function (_super) {
11366
11374
  configurable: true
11367
11375
  });
11368
11376
  Object.defineProperty(Line.prototype, "_effectiveX2", {
11377
+ /** @internal */
11369
11378
  get: function () {
11370
11379
  return (this._connectedControl ? this._connectedControl.centerX : 0) + this._x2.getValue(this._host);
11371
11380
  },
@@ -11373,6 +11382,7 @@ var Line = /** @class */ (function (_super) {
11373
11382
  configurable: true
11374
11383
  });
11375
11384
  Object.defineProperty(Line.prototype, "_effectiveY2", {
11385
+ /** @internal */
11376
11386
  get: function () {
11377
11387
  return (this._connectedControl ? this._connectedControl.centerY : 0) + this._y2.getValue(this._host);
11378
11388
  },