babylonjs-gui 5.40.1 → 5.42.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 +29 -11
- package/babylon.gui.js +109 -48
- package/babylon.gui.js.map +1 -1
- package/babylon.gui.min.js +1 -1
- package/babylon.gui.min.js.map +1 -1
- package/babylon.gui.module.d.ts +59 -22
- package/package.json +2 -2
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
|
-
|
|
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
|
-
|
|
1567
|
+
invalidateRect(): void;
|
|
1568
1568
|
/**
|
|
1569
1569
|
* @internal
|
|
1570
1570
|
*/
|
|
@@ -2063,6 +2063,10 @@ declare module BABYLON.GUI {
|
|
|
2063
2063
|
private _populateNinePatchSlicesFromImage;
|
|
2064
2064
|
private _detectPointerOnOpaqueOnly;
|
|
2065
2065
|
private _imageDataCache;
|
|
2066
|
+
static SourceImgCache: Map<string, {
|
|
2067
|
+
img: BABYLON.IImage;
|
|
2068
|
+
timesUsed: number;
|
|
2069
|
+
}>;
|
|
2066
2070
|
/**
|
|
2067
2071
|
* BABYLON.Observable notified when the content is loaded
|
|
2068
2072
|
*/
|
|
@@ -2169,6 +2173,11 @@ declare module BABYLON.GUI {
|
|
|
2169
2173
|
* Gets the image source url
|
|
2170
2174
|
*/
|
|
2171
2175
|
get source(): BABYLON.Nullable<string>;
|
|
2176
|
+
/**
|
|
2177
|
+
* Resets the internal Image Element cache. Can reduce memory usage.
|
|
2178
|
+
*/
|
|
2179
|
+
static ResetImageCache(): void;
|
|
2180
|
+
private _removeCacheUsage;
|
|
2172
2181
|
/**
|
|
2173
2182
|
* Gets or sets image source url
|
|
2174
2183
|
*/
|
|
@@ -2430,6 +2439,10 @@ declare module BABYLON.GUI {
|
|
|
2430
2439
|
_onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number, pi: BABYLON.PointerInfoBase): void;
|
|
2431
2440
|
_onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
|
|
2432
2441
|
protected _beforeRenderText(textWrapper: TextWrapper): TextWrapper;
|
|
2442
|
+
/** @internal */
|
|
2443
|
+
private set isTextHighlightOn(value);
|
|
2444
|
+
/** @internal */
|
|
2445
|
+
private get isTextHighlightOn();
|
|
2433
2446
|
dispose(): void;
|
|
2434
2447
|
}
|
|
2435
2448
|
|
|
@@ -2527,14 +2540,13 @@ declare module BABYLON.GUI {
|
|
|
2527
2540
|
* @internal
|
|
2528
2541
|
*/
|
|
2529
2542
|
protected _preMeasure(parentMeasure: Measure, context: BABYLON.ICanvasRenderingContext): void;
|
|
2543
|
+
private _computeScroll;
|
|
2530
2544
|
/**
|
|
2531
2545
|
* Processing of child after the parent measurement update
|
|
2532
2546
|
*
|
|
2533
|
-
* @param parentMeasure The parent measure
|
|
2534
|
-
* @param context The rendering canvas
|
|
2535
2547
|
* @internal
|
|
2536
2548
|
*/
|
|
2537
|
-
protected _additionalProcessing(
|
|
2549
|
+
protected _additionalProcessing(): void;
|
|
2538
2550
|
private _drawText;
|
|
2539
2551
|
/**
|
|
2540
2552
|
* Copy the text in the clipboard
|
|
@@ -2590,10 +2602,14 @@ declare module BABYLON.GUI {
|
|
|
2590
2602
|
export class Line extends Control {
|
|
2591
2603
|
name?: string | undefined;
|
|
2592
2604
|
private _lineWidth;
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2605
|
+
/** @internal */
|
|
2606
|
+
_x1: ValueAndUnit;
|
|
2607
|
+
/** @internal */
|
|
2608
|
+
_y1: ValueAndUnit;
|
|
2609
|
+
/** @internal */
|
|
2610
|
+
_x2: ValueAndUnit;
|
|
2611
|
+
/** @internal */
|
|
2612
|
+
_y2: ValueAndUnit;
|
|
2597
2613
|
private _dash;
|
|
2598
2614
|
private _connectedControl;
|
|
2599
2615
|
private _connectedControlDirtyObserver;
|
|
@@ -2622,8 +2638,10 @@ declare module BABYLON.GUI {
|
|
|
2622
2638
|
set horizontalAlignment(value: number);
|
|
2623
2639
|
/** Gets or sets vertical alignment */
|
|
2624
2640
|
set verticalAlignment(value: number);
|
|
2625
|
-
|
|
2626
|
-
|
|
2641
|
+
/** @internal */
|
|
2642
|
+
get _effectiveX2(): number;
|
|
2643
|
+
/** @internal */
|
|
2644
|
+
get _effectiveY2(): number;
|
|
2627
2645
|
/**
|
|
2628
2646
|
* Creates a new Line
|
|
2629
2647
|
* @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);
|
|
@@ -8402,6 +8406,7 @@ var Image = /** @class */ (function (_super) {
|
|
|
8402
8406
|
if (this._source === value) {
|
|
8403
8407
|
return;
|
|
8404
8408
|
}
|
|
8409
|
+
this._removeCacheUsage(this._source);
|
|
8405
8410
|
this._loaded = false;
|
|
8406
8411
|
this._source = value;
|
|
8407
8412
|
this._imageDataCache.data = null;
|
|
@@ -8413,7 +8418,17 @@ var Image = /** @class */ (function (_super) {
|
|
|
8413
8418
|
if (!engine) {
|
|
8414
8419
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
8415
8420
|
}
|
|
8421
|
+
if (value && Image.SourceImgCache.has(value)) {
|
|
8422
|
+
var cachedData = Image.SourceImgCache.get(value);
|
|
8423
|
+
this._domImage = cachedData.img;
|
|
8424
|
+
cachedData.timesUsed += 1;
|
|
8425
|
+
this._onImageLoaded();
|
|
8426
|
+
return;
|
|
8427
|
+
}
|
|
8416
8428
|
this._domImage = engine.createCanvasImage();
|
|
8429
|
+
if (value) {
|
|
8430
|
+
Image.SourceImgCache.set(value, { img: this._domImage, timesUsed: 1 });
|
|
8431
|
+
}
|
|
8417
8432
|
this._domImage.onload = function () {
|
|
8418
8433
|
_this._onImageLoaded();
|
|
8419
8434
|
};
|
|
@@ -8426,6 +8441,22 @@ var Image = /** @class */ (function (_super) {
|
|
|
8426
8441
|
enumerable: false,
|
|
8427
8442
|
configurable: true
|
|
8428
8443
|
});
|
|
8444
|
+
/**
|
|
8445
|
+
* Resets the internal Image Element cache. Can reduce memory usage.
|
|
8446
|
+
*/
|
|
8447
|
+
Image.ResetImageCache = function () {
|
|
8448
|
+
Image.SourceImgCache.clear();
|
|
8449
|
+
};
|
|
8450
|
+
Image.prototype._removeCacheUsage = function (source) {
|
|
8451
|
+
var value = source && Image.SourceImgCache.get(source);
|
|
8452
|
+
if (value) {
|
|
8453
|
+
value.timesUsed -= 1;
|
|
8454
|
+
// Since the image isn't being used anymore, we can clean it from the cache
|
|
8455
|
+
if (value.timesUsed === 0) {
|
|
8456
|
+
Image.SourceImgCache.delete(source);
|
|
8457
|
+
}
|
|
8458
|
+
}
|
|
8459
|
+
};
|
|
8429
8460
|
/**
|
|
8430
8461
|
* Checks for svg document with icon id present
|
|
8431
8462
|
* @param value
|
|
@@ -8760,7 +8791,9 @@ var Image = /** @class */ (function (_super) {
|
|
|
8760
8791
|
_super.prototype.dispose.call(this);
|
|
8761
8792
|
this.onImageLoadedObservable.clear();
|
|
8762
8793
|
this.onSVGAttributesComputedObservable.clear();
|
|
8794
|
+
this._removeCacheUsage(this._source);
|
|
8763
8795
|
};
|
|
8796
|
+
Image.SourceImgCache = new Map();
|
|
8764
8797
|
// Static
|
|
8765
8798
|
/** STRETCH_NONE */
|
|
8766
8799
|
Image.STRETCH_NONE = 0;
|
|
@@ -9490,10 +9523,10 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9490
9523
|
case 8: // BACKSPACE
|
|
9491
9524
|
if (this._textWrapper.text && this._textWrapper.length > 0) {
|
|
9492
9525
|
//delete the highlighted text
|
|
9493
|
-
if (this.
|
|
9526
|
+
if (this.isTextHighlightOn) {
|
|
9494
9527
|
this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);
|
|
9495
9528
|
this._textHasChanged();
|
|
9496
|
-
this.
|
|
9529
|
+
this.isTextHighlightOn = false;
|
|
9497
9530
|
this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;
|
|
9498
9531
|
this._blinkIsEven = false;
|
|
9499
9532
|
if (evt) {
|
|
@@ -9518,10 +9551,10 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9518
9551
|
}
|
|
9519
9552
|
return;
|
|
9520
9553
|
case 46: // DELETE
|
|
9521
|
-
if (this.
|
|
9554
|
+
if (this.isTextHighlightOn) {
|
|
9522
9555
|
this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);
|
|
9523
9556
|
this._textHasChanged();
|
|
9524
|
-
this.
|
|
9557
|
+
this.isTextHighlightOn = false;
|
|
9525
9558
|
this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;
|
|
9526
9559
|
if (evt) {
|
|
9527
9560
|
evt.preventDefault();
|
|
@@ -9540,18 +9573,18 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9540
9573
|
return;
|
|
9541
9574
|
case 13: // RETURN
|
|
9542
9575
|
this._host.focusedControl = null;
|
|
9543
|
-
this.
|
|
9576
|
+
this.isTextHighlightOn = false;
|
|
9544
9577
|
return;
|
|
9545
9578
|
case 35: // END
|
|
9546
9579
|
this._cursorOffset = 0;
|
|
9547
9580
|
this._blinkIsEven = false;
|
|
9548
|
-
this.
|
|
9581
|
+
this.isTextHighlightOn = false;
|
|
9549
9582
|
this._markAsDirty();
|
|
9550
9583
|
return;
|
|
9551
9584
|
case 36: // HOME
|
|
9552
9585
|
this._cursorOffset = this._textWrapper.length;
|
|
9553
9586
|
this._blinkIsEven = false;
|
|
9554
|
-
this.
|
|
9587
|
+
this.isTextHighlightOn = false;
|
|
9555
9588
|
this._markAsDirty();
|
|
9556
9589
|
return;
|
|
9557
9590
|
case 37: // LEFT
|
|
@@ -9564,7 +9597,7 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9564
9597
|
this._blinkIsEven = false;
|
|
9565
9598
|
// shift + ctrl/cmd + <-
|
|
9566
9599
|
if (evt.ctrlKey || evt.metaKey) {
|
|
9567
|
-
if (!this.
|
|
9600
|
+
if (!this.isTextHighlightOn) {
|
|
9568
9601
|
if (this._textWrapper.length === this._cursorOffset) {
|
|
9569
9602
|
return;
|
|
9570
9603
|
}
|
|
@@ -9575,13 +9608,13 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9575
9608
|
this._startHighlightIndex = 0;
|
|
9576
9609
|
this._cursorIndex = this._textWrapper.length - this._endHighlightIndex;
|
|
9577
9610
|
this._cursorOffset = this._textWrapper.length;
|
|
9578
|
-
this.
|
|
9611
|
+
this.isTextHighlightOn = true;
|
|
9579
9612
|
this._markAsDirty();
|
|
9580
9613
|
return;
|
|
9581
9614
|
}
|
|
9582
9615
|
//store the starting point
|
|
9583
|
-
if (!this.
|
|
9584
|
-
this.
|
|
9616
|
+
if (!this.isTextHighlightOn) {
|
|
9617
|
+
this.isTextHighlightOn = true;
|
|
9585
9618
|
this._cursorIndex = this._cursorOffset >= this._textWrapper.length ? this._textWrapper.length : this._cursorOffset - 1;
|
|
9586
9619
|
}
|
|
9587
9620
|
//if text is already highlighted
|
|
@@ -9599,21 +9632,21 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9599
9632
|
this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;
|
|
9600
9633
|
}
|
|
9601
9634
|
else {
|
|
9602
|
-
this.
|
|
9635
|
+
this.isTextHighlightOn = false;
|
|
9603
9636
|
}
|
|
9604
9637
|
this._markAsDirty();
|
|
9605
9638
|
return;
|
|
9606
9639
|
}
|
|
9607
|
-
if (this.
|
|
9640
|
+
if (this.isTextHighlightOn) {
|
|
9608
9641
|
this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;
|
|
9609
|
-
this.
|
|
9642
|
+
this.isTextHighlightOn = false;
|
|
9610
9643
|
}
|
|
9611
9644
|
if (evt && (evt.ctrlKey || evt.metaKey)) {
|
|
9612
9645
|
this._cursorOffset = this._textWrapper.length;
|
|
9613
9646
|
evt.preventDefault();
|
|
9614
9647
|
}
|
|
9615
9648
|
this._blinkIsEven = false;
|
|
9616
|
-
this.
|
|
9649
|
+
this.isTextHighlightOn = false;
|
|
9617
9650
|
this._cursorIndex = -1;
|
|
9618
9651
|
this._markAsDirty();
|
|
9619
9652
|
return;
|
|
@@ -9627,7 +9660,7 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9627
9660
|
this._blinkIsEven = false;
|
|
9628
9661
|
//shift + ctrl/cmd + ->
|
|
9629
9662
|
if (evt.ctrlKey || evt.metaKey) {
|
|
9630
|
-
if (!this.
|
|
9663
|
+
if (!this.isTextHighlightOn) {
|
|
9631
9664
|
if (this._cursorOffset === 0) {
|
|
9632
9665
|
return;
|
|
9633
9666
|
}
|
|
@@ -9636,14 +9669,14 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9636
9669
|
}
|
|
9637
9670
|
}
|
|
9638
9671
|
this._endHighlightIndex = this._textWrapper.length;
|
|
9639
|
-
this.
|
|
9672
|
+
this.isTextHighlightOn = true;
|
|
9640
9673
|
this._cursorIndex = this._textWrapper.length - this._startHighlightIndex;
|
|
9641
9674
|
this._cursorOffset = 0;
|
|
9642
9675
|
this._markAsDirty();
|
|
9643
9676
|
return;
|
|
9644
9677
|
}
|
|
9645
|
-
if (!this.
|
|
9646
|
-
this.
|
|
9678
|
+
if (!this.isTextHighlightOn) {
|
|
9679
|
+
this.isTextHighlightOn = true;
|
|
9647
9680
|
this._cursorIndex = this._cursorOffset <= 0 ? 0 : this._cursorOffset + 1;
|
|
9648
9681
|
}
|
|
9649
9682
|
//if text is already highlighted
|
|
@@ -9661,14 +9694,14 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9661
9694
|
this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;
|
|
9662
9695
|
}
|
|
9663
9696
|
else {
|
|
9664
|
-
this.
|
|
9697
|
+
this.isTextHighlightOn = false;
|
|
9665
9698
|
}
|
|
9666
9699
|
this._markAsDirty();
|
|
9667
9700
|
return;
|
|
9668
9701
|
}
|
|
9669
|
-
if (this.
|
|
9702
|
+
if (this.isTextHighlightOn) {
|
|
9670
9703
|
this._cursorOffset = this._textWrapper.length - this._endHighlightIndex;
|
|
9671
|
-
this.
|
|
9704
|
+
this.isTextHighlightOn = false;
|
|
9672
9705
|
}
|
|
9673
9706
|
//ctr + ->
|
|
9674
9707
|
if (evt && (evt.ctrlKey || evt.metaKey)) {
|
|
@@ -9676,7 +9709,7 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9676
9709
|
evt.preventDefault();
|
|
9677
9710
|
}
|
|
9678
9711
|
this._blinkIsEven = false;
|
|
9679
|
-
this.
|
|
9712
|
+
this.isTextHighlightOn = false;
|
|
9680
9713
|
this._cursorIndex = -1;
|
|
9681
9714
|
this._markAsDirty();
|
|
9682
9715
|
return;
|
|
@@ -9701,11 +9734,11 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9701
9734
|
this.onBeforeKeyAddObservable.notifyObservers(this);
|
|
9702
9735
|
key = this._currentKey;
|
|
9703
9736
|
if (this._addKey && !this._deadKey) {
|
|
9704
|
-
if (this.
|
|
9737
|
+
if (this.isTextHighlightOn) {
|
|
9705
9738
|
this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex, key);
|
|
9706
9739
|
this._textHasChanged();
|
|
9707
9740
|
this._cursorOffset = this._textWrapper.length - (this._startHighlightIndex + 1);
|
|
9708
|
-
this.
|
|
9741
|
+
this.isTextHighlightOn = false;
|
|
9709
9742
|
this._blinkIsEven = false;
|
|
9710
9743
|
this._markAsDirty();
|
|
9711
9744
|
}
|
|
@@ -9739,12 +9772,12 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9739
9772
|
this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;
|
|
9740
9773
|
}
|
|
9741
9774
|
else {
|
|
9742
|
-
this.
|
|
9775
|
+
this.isTextHighlightOn = false;
|
|
9743
9776
|
this._markAsDirty();
|
|
9744
9777
|
return;
|
|
9745
9778
|
}
|
|
9746
9779
|
}
|
|
9747
|
-
this.
|
|
9780
|
+
this.isTextHighlightOn = true;
|
|
9748
9781
|
this._markAsDirty();
|
|
9749
9782
|
};
|
|
9750
9783
|
/**
|
|
@@ -9761,8 +9794,7 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9761
9794
|
moveLeft = this._startHighlightIndex > 0 && this._textWrapper.isWord(this._startHighlightIndex - 1) ? --this._startHighlightIndex : 0;
|
|
9762
9795
|
} while (moveLeft || moveRight);
|
|
9763
9796
|
this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;
|
|
9764
|
-
this.
|
|
9765
|
-
this._isTextHighlightOn = true;
|
|
9797
|
+
this.isTextHighlightOn = true;
|
|
9766
9798
|
this._clickedCoordinate = null;
|
|
9767
9799
|
this._blinkIsEven = true;
|
|
9768
9800
|
this._cursorIndex = -1;
|
|
@@ -9771,7 +9803,7 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9771
9803
|
/** @internal */
|
|
9772
9804
|
InputText.prototype._selectAllText = function () {
|
|
9773
9805
|
this._blinkIsEven = true;
|
|
9774
|
-
this.
|
|
9806
|
+
this.isTextHighlightOn = true;
|
|
9775
9807
|
this._startHighlightIndex = 0;
|
|
9776
9808
|
this._endHighlightIndex = this._textWrapper.length;
|
|
9777
9809
|
this._cursorOffset = this._textWrapper.length;
|
|
@@ -9791,7 +9823,7 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9791
9823
|
* @internal
|
|
9792
9824
|
*/
|
|
9793
9825
|
InputText.prototype._onCopyText = function (ev) {
|
|
9794
|
-
this.
|
|
9826
|
+
this.isTextHighlightOn = false;
|
|
9795
9827
|
//when write permission to clipbaord data is denied
|
|
9796
9828
|
try {
|
|
9797
9829
|
ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText);
|
|
@@ -9808,7 +9840,7 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9808
9840
|
}
|
|
9809
9841
|
this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);
|
|
9810
9842
|
this._textHasChanged();
|
|
9811
|
-
this.
|
|
9843
|
+
this.isTextHighlightOn = false;
|
|
9812
9844
|
this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;
|
|
9813
9845
|
//when write permission to clipbaord data is denied
|
|
9814
9846
|
try {
|
|
@@ -9936,7 +9968,7 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9936
9968
|
cursorLeft = clipTextLeft + availableWidth;
|
|
9937
9969
|
this._markAsDirty();
|
|
9938
9970
|
}
|
|
9939
|
-
if (!this.
|
|
9971
|
+
if (!this.isTextHighlightOn) {
|
|
9940
9972
|
context.fillRect(cursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, 2, this._fontOffset.height);
|
|
9941
9973
|
}
|
|
9942
9974
|
}
|
|
@@ -9946,7 +9978,7 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9946
9978
|
_this._markAsDirty();
|
|
9947
9979
|
}, 500);
|
|
9948
9980
|
//show the highlighted text
|
|
9949
|
-
if (this.
|
|
9981
|
+
if (this.isTextHighlightOn) {
|
|
9950
9982
|
clearTimeout(this._blinkTimeout);
|
|
9951
9983
|
var highlightCursorOffsetWidth = context.measureText(text.substring(this._startHighlightIndex)).width;
|
|
9952
9984
|
var highlightCursorLeft = this._scrollLeft + this._textWidth - highlightCursorOffsetWidth;
|
|
@@ -9994,7 +10026,7 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9994
10026
|
return true;
|
|
9995
10027
|
}
|
|
9996
10028
|
this._clickedCoordinate = coordinates.x;
|
|
9997
|
-
this.
|
|
10029
|
+
this.isTextHighlightOn = false;
|
|
9998
10030
|
this._highlightedText = "";
|
|
9999
10031
|
this._cursorIndex = -1;
|
|
10000
10032
|
this._isPointerDown = true;
|
|
@@ -10028,6 +10060,24 @@ var InputText = /** @class */ (function (_super) {
|
|
|
10028
10060
|
InputText.prototype._beforeRenderText = function (textWrapper) {
|
|
10029
10061
|
return textWrapper;
|
|
10030
10062
|
};
|
|
10063
|
+
Object.defineProperty(InputText.prototype, "isTextHighlightOn", {
|
|
10064
|
+
/** @internal */
|
|
10065
|
+
get: function () {
|
|
10066
|
+
return this._isTextHighlightOn;
|
|
10067
|
+
},
|
|
10068
|
+
/** @internal */
|
|
10069
|
+
set: function (value) {
|
|
10070
|
+
if (this._isTextHighlightOn === value) {
|
|
10071
|
+
return;
|
|
10072
|
+
}
|
|
10073
|
+
if (value) {
|
|
10074
|
+
this.onTextHighlightObservable.notifyObservers(this);
|
|
10075
|
+
}
|
|
10076
|
+
this._isTextHighlightOn = value;
|
|
10077
|
+
},
|
|
10078
|
+
enumerable: false,
|
|
10079
|
+
configurable: true
|
|
10080
|
+
});
|
|
10031
10081
|
InputText.prototype.dispose = function () {
|
|
10032
10082
|
_super.prototype.dispose.call(this);
|
|
10033
10083
|
this.onBlurObservable.clear();
|
|
@@ -10702,17 +10752,9 @@ var InputTextArea = /** @class */ (function (_super) {
|
|
|
10702
10752
|
}
|
|
10703
10753
|
}
|
|
10704
10754
|
};
|
|
10705
|
-
|
|
10706
|
-
|
|
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);
|
|
10755
|
+
InputTextArea.prototype._computeScroll = function () {
|
|
10756
|
+
this._clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width);
|
|
10757
|
+
this._clipTextTop = this._currentMeasure.top + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.height);
|
|
10716
10758
|
if (this._isFocused && this._lines[this._cursorInfo.currentLineIndex].width > this._availableWidth) {
|
|
10717
10759
|
var textLeft = this._clipTextLeft - this._lines[this._cursorInfo.currentLineIndex].width + this._availableWidth;
|
|
10718
10760
|
if (!this._scrollLeft) {
|
|
@@ -10732,6 +10774,13 @@ var InputTextArea = /** @class */ (function (_super) {
|
|
|
10732
10774
|
else {
|
|
10733
10775
|
this._scrollTop = this._clipTextTop;
|
|
10734
10776
|
}
|
|
10777
|
+
};
|
|
10778
|
+
/**
|
|
10779
|
+
* Processing of child after the parent measurement update
|
|
10780
|
+
*
|
|
10781
|
+
* @internal
|
|
10782
|
+
*/
|
|
10783
|
+
InputTextArea.prototype._additionalProcessing = function () {
|
|
10735
10784
|
// Flush the highlighted text each frame
|
|
10736
10785
|
this.highlightedText = "";
|
|
10737
10786
|
this.onLinesReadyObservable.notifyObservers(this);
|
|
@@ -10819,6 +10868,7 @@ var InputTextArea = /** @class */ (function (_super) {
|
|
|
10819
10868
|
};
|
|
10820
10869
|
InputTextArea.prototype._draw = function (context) {
|
|
10821
10870
|
var _a, _b;
|
|
10871
|
+
this._computeScroll();
|
|
10822
10872
|
this._scrollLeft = (_a = this._scrollLeft) !== null && _a !== void 0 ? _a : 0;
|
|
10823
10873
|
this._scrollTop = (_b = this._scrollTop) !== null && _b !== void 0 ? _b : 0;
|
|
10824
10874
|
context.save();
|
|
@@ -11221,9 +11271,13 @@ var Line = /** @class */ (function (_super) {
|
|
|
11221
11271
|
var _this = _super.call(this, name) || this;
|
|
11222
11272
|
_this.name = name;
|
|
11223
11273
|
_this._lineWidth = 1;
|
|
11274
|
+
/** @internal */
|
|
11224
11275
|
_this._x1 = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(0);
|
|
11276
|
+
/** @internal */
|
|
11225
11277
|
_this._y1 = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(0);
|
|
11278
|
+
/** @internal */
|
|
11226
11279
|
_this._x2 = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(0);
|
|
11280
|
+
/** @internal */
|
|
11227
11281
|
_this._y2 = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(0);
|
|
11228
11282
|
_this._dash = new Array();
|
|
11229
11283
|
_this._automaticSize = true;
|
|
@@ -11366,6 +11420,7 @@ var Line = /** @class */ (function (_super) {
|
|
|
11366
11420
|
configurable: true
|
|
11367
11421
|
});
|
|
11368
11422
|
Object.defineProperty(Line.prototype, "_effectiveX2", {
|
|
11423
|
+
/** @internal */
|
|
11369
11424
|
get: function () {
|
|
11370
11425
|
return (this._connectedControl ? this._connectedControl.centerX : 0) + this._x2.getValue(this._host);
|
|
11371
11426
|
},
|
|
@@ -11373,6 +11428,7 @@ var Line = /** @class */ (function (_super) {
|
|
|
11373
11428
|
configurable: true
|
|
11374
11429
|
});
|
|
11375
11430
|
Object.defineProperty(Line.prototype, "_effectiveY2", {
|
|
11431
|
+
/** @internal */
|
|
11376
11432
|
get: function () {
|
|
11377
11433
|
return (this._connectedControl ? this._connectedControl.centerY : 0) + this._y2.getValue(this._host);
|
|
11378
11434
|
},
|
|
@@ -21951,6 +22007,10 @@ var Slider3D = /** @class */ (function (_super) {
|
|
|
21951
22007
|
sliderBackplate.visibility = 0;
|
|
21952
22008
|
sliderBackplate.scaling = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector3(1, 0.5, 0.8);
|
|
21953
22009
|
core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.SceneLoader.ImportMeshAsync(undefined, Slider3D.MODEL_BASE_URL, Slider3D.MODEL_FILENAME, scene).then(function (result) {
|
|
22010
|
+
// make all meshes not pickable. Required meshes' pickable state will be set later.
|
|
22011
|
+
result.meshes.forEach(function (m) {
|
|
22012
|
+
m.isPickable = false;
|
|
22013
|
+
});
|
|
21954
22014
|
var sliderBackplateModel = result.meshes[1];
|
|
21955
22015
|
var sliderBarModel = result.meshes[1].clone("".concat(_this.name, "_sliderbar"), sliderBackplate);
|
|
21956
22016
|
var sliderThumbModel = result.meshes[1].clone("".concat(_this.name, "_sliderthumb"), sliderBackplate);
|
|
@@ -21958,7 +22018,6 @@ var Slider3D = /** @class */ (function (_super) {
|
|
|
21958
22018
|
if (_this._sliderBackplateVisible) {
|
|
21959
22019
|
sliderBackplateModel.visibility = 1;
|
|
21960
22020
|
sliderBackplateModel.name = "".concat(_this.name, "_sliderbackplate");
|
|
21961
|
-
sliderBackplateModel.isPickable = false;
|
|
21962
22021
|
sliderBackplateModel.scaling.x = 1;
|
|
21963
22022
|
sliderBackplateModel.scaling.z = 0.2;
|
|
21964
22023
|
sliderBackplateModel.parent = sliderBackplate;
|
|
@@ -21971,7 +22030,6 @@ var Slider3D = /** @class */ (function (_super) {
|
|
|
21971
22030
|
sliderBarModel.parent = sliderBackplate;
|
|
21972
22031
|
sliderBarModel.position.z = -0.1;
|
|
21973
22032
|
sliderBarModel.scaling = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector3(SLIDER_SCALING - SLIDER_MARGIN, 0.04, 0.3);
|
|
21974
|
-
sliderBarModel.isPickable = false;
|
|
21975
22033
|
if (_this._sliderBarMaterial) {
|
|
21976
22034
|
sliderBarModel.material = _this._sliderBarMaterial;
|
|
21977
22035
|
}
|
|
@@ -29026,6 +29084,9 @@ var MRDLSliderThumbMaterial = /** @class */ (function (_super) {
|
|
|
29026
29084
|
_this.alphaMode = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Constants.ALPHA_DISABLE;
|
|
29027
29085
|
_this.backFaceCulling = false;
|
|
29028
29086
|
_this._blueGradientTexture = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture(MRDLSliderThumbMaterial.BLUE_GRADIENT_TEXTURE_URL, scene, true, false, core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture.NEAREST_SAMPLINGMODE);
|
|
29087
|
+
_this._decalTexture = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture("", _this.getScene());
|
|
29088
|
+
_this._reflectionMapTexture = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture("", _this.getScene());
|
|
29089
|
+
_this._indirectEnvTexture = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture("", _this.getScene());
|
|
29029
29090
|
return _this;
|
|
29030
29091
|
}
|
|
29031
29092
|
MRDLSliderThumbMaterial.prototype.needAlphaBlending = function () {
|