@solidtv/renderer 1.5.0 → 1.5.1
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/src/common/EventEmitter.d.ts +8 -0
- package/dist/src/common/EventEmitter.js +20 -0
- package/dist/src/common/EventEmitter.js.map +1 -1
- package/dist/src/core/Autosizer.js +3 -1
- package/dist/src/core/Autosizer.js.map +1 -1
- package/dist/src/core/CoreNode.d.ts +39 -0
- package/dist/src/core/CoreNode.js +105 -25
- package/dist/src/core/CoreNode.js.map +1 -1
- package/dist/src/core/CoreTextNode.js +4 -2
- package/dist/src/core/CoreTextNode.js.map +1 -1
- package/dist/src/core/Stage.js +2 -0
- package/dist/src/core/Stage.js.map +1 -1
- package/dist/src/core/TextureMemoryManager.d.ts +39 -2
- package/dist/src/core/TextureMemoryManager.js +53 -1
- package/dist/src/core/TextureMemoryManager.js.map +1 -1
- package/dist/src/core/renderers/canvas/CanvasRenderer.js +5 -1
- package/dist/src/core/renderers/canvas/CanvasRenderer.js.map +1 -1
- package/dist/src/core/renderers/webgl/WebGlRenderer.js +5 -1
- package/dist/src/core/renderers/webgl/WebGlRenderer.js.map +1 -1
- package/dist/src/core/renderers/webgl/WebGlShaderProgram.d.ts +28 -0
- package/dist/src/core/renderers/webgl/WebGlShaderProgram.js +70 -10
- package/dist/src/core/renderers/webgl/WebGlShaderProgram.js.map +1 -1
- package/dist/tsconfig.dist.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/common/EventEmitter.ts +21 -0
- package/src/core/Autosizer.ts +3 -1
- package/src/core/CoreNode.test.ts +283 -0
- package/src/core/CoreNode.ts +131 -26
- package/src/core/CoreTextNode.test.ts +1 -0
- package/src/core/CoreTextNode.ts +6 -2
- package/src/core/Stage.ts +2 -0
- package/src/core/TextureMemoryManager.test.ts +272 -5
- package/src/core/TextureMemoryManager.ts +59 -2
- package/src/core/renderers/canvas/CanvasRenderer.ts +7 -1
- package/src/core/renderers/webgl/WebGlRenderer.ts +6 -1
- package/src/core/renderers/webgl/WebGlShaderProgram.ts +78 -15
- package/src/core/renderers/webgl/WebGlShaderProgram.uniformDedup.test.ts +233 -0
|
@@ -14,5 +14,13 @@ export declare class EventEmitter implements IEventEmitter {
|
|
|
14
14
|
off(event: string, listener?: (target: any, data: any) => void): void;
|
|
15
15
|
once(event: string, listener: (target: any, data: any) => void): void;
|
|
16
16
|
emit(event: string, data?: any): void;
|
|
17
|
+
/**
|
|
18
|
+
* Whether any listener is currently registered for any event.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Used as a liveness signal: a `Texture` with no listeners has no
|
|
22
|
+
* `CoreNode` (or `SubTexture`) subscribed to it.
|
|
23
|
+
*/
|
|
24
|
+
hasListeners(): boolean;
|
|
17
25
|
removeAllListeners(): void;
|
|
18
26
|
}
|
|
@@ -59,6 +59,26 @@ export class EventEmitter {
|
|
|
59
59
|
listener(this, data);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Whether any listener is currently registered for any event.
|
|
64
|
+
*
|
|
65
|
+
* @remarks
|
|
66
|
+
* Used as a liveness signal: a `Texture` with no listeners has no
|
|
67
|
+
* `CoreNode` (or `SubTexture`) subscribed to it.
|
|
68
|
+
*/
|
|
69
|
+
hasListeners() {
|
|
70
|
+
const map = this.eventListeners;
|
|
71
|
+
if (map === null) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
for (const event in map) {
|
|
75
|
+
const listeners = map[event];
|
|
76
|
+
if (listeners !== undefined && listeners.length > 0) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
62
82
|
removeAllListeners() {
|
|
63
83
|
this.eventListeners = null;
|
|
64
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventEmitter.js","sourceRoot":"","sources":["../../../src/common/EventEmitter.ts"],"names":[],"mappings":"AAM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C,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YAClC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,YAAY;QACV,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC;QAChC,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACjB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;YACxB,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;YAC7B,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpD,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -13,7 +13,9 @@ export var AutosizeUpdateType;
|
|
|
13
13
|
const applyDimensions = (node, w, h) => {
|
|
14
14
|
node.props.w = w;
|
|
15
15
|
node.props.h = h;
|
|
16
|
-
|
|
16
|
+
// Direct props.w/h write bypasses the w/h setters, so raise RecalcUniforms
|
|
17
|
+
// here too — dimensions feed shader uniforms.
|
|
18
|
+
node.setUpdateType(UpdateType.Local | UpdateType.RecalcUniforms);
|
|
17
19
|
};
|
|
18
20
|
const getFilteredChildren = (children, childMap) => {
|
|
19
21
|
const filtered = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autosizer.js","sourceRoot":"","sources":["../../../src/core/Autosizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,eAAe,CAAC;AAG1D,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,uDAAY,CAAA;IACZ,qDAAW,CAAA;AACb,CAAC,EAHW,YAAY,KAAZ,YA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placeholder color shown while the Node's texture is not yet loaded.
|
|
327
|
+
*
|
|
328
|
+
* @remarks
|
|
329
|
+
* When set to a non-zero color and the Node has a texture (e.g. {@link src}),
|
|
330
|
+
* the Node renders a solid rectangle of this color until the texture
|
|
331
|
+
* finishes loading, instead of rendering nothing. The placeholder renders
|
|
332
|
+
* through the Node's shader, so rounded corners and borders apply to it.
|
|
333
|
+
* It also shows again if the texture is freed under memory pressure (until
|
|
334
|
+
* the reload completes) and remains if the texture permanently fails.
|
|
335
|
+
*
|
|
336
|
+
* The color value is a number in the format 0xRRGGBBAA. Set to `0` to
|
|
337
|
+
* disable (default). Has no effect on Nodes without a texture.
|
|
338
|
+
*
|
|
339
|
+
* @default `0`
|
|
340
|
+
*/
|
|
341
|
+
placeholderColor: number;
|
|
325
342
|
/**
|
|
326
343
|
* The Node's parent Node.
|
|
327
344
|
*
|
|
@@ -704,6 +721,14 @@ export declare class CoreNode extends EventEmitter {
|
|
|
704
721
|
hasShaderTimeFn: boolean;
|
|
705
722
|
private hasColorProps;
|
|
706
723
|
textureLoaded: boolean;
|
|
724
|
+
/**
|
|
725
|
+
* True while this node should render its `placeholderColor` instead of its
|
|
726
|
+
* texture: `placeholderColor` is non-zero, a texture is set, and that
|
|
727
|
+
* texture is not loaded. Read by the renderers' quad path to substitute the
|
|
728
|
+
* stage's default (1x1 white) texture. Maintained by
|
|
729
|
+
* {@link updatePlaceholderActive} — never written elsewhere.
|
|
730
|
+
*/
|
|
731
|
+
placeholderActive: boolean;
|
|
707
732
|
updateType: UpdateType;
|
|
708
733
|
childUpdateType: UpdateType;
|
|
709
734
|
globalTransform?: Matrix3d;
|
|
@@ -767,6 +792,18 @@ export declare class CoreNode extends EventEmitter {
|
|
|
767
792
|
parentAutosizer: Autosizer | null;
|
|
768
793
|
destroyed: boolean;
|
|
769
794
|
constructor(stage: Stage, props: CoreNodeProps);
|
|
795
|
+
/**
|
|
796
|
+
* Recompute {@link placeholderActive} after any of its inputs changed
|
|
797
|
+
* (placeholderColor, texture, textureLoaded).
|
|
798
|
+
*
|
|
799
|
+
* @remarks
|
|
800
|
+
* On a toggle this raises `PremultipliedColors` (the quad's vertex colors
|
|
801
|
+
* switch between the placeholder color and the regular color props — this
|
|
802
|
+
* also marks the quad dirty) and `IsRenderable` (a loading texture with a
|
|
803
|
+
* placeholder is renderable). Both are processed in the same frame's update
|
|
804
|
+
* pass, before quads are submitted.
|
|
805
|
+
*/
|
|
806
|
+
private updatePlaceholderActive;
|
|
770
807
|
loadTexture(): void;
|
|
771
808
|
/**
|
|
772
809
|
* Task for queueMicrotask to loadTexture
|
|
@@ -895,6 +932,8 @@ export declare class CoreNode extends EventEmitter {
|
|
|
895
932
|
set clipping(value: boolean | [number, number, number, number]);
|
|
896
933
|
get color(): number;
|
|
897
934
|
set color(value: number);
|
|
935
|
+
get placeholderColor(): number;
|
|
936
|
+
set placeholderColor(value: number);
|
|
898
937
|
get colorTop(): number;
|
|
899
938
|
set colorTop(value: number);
|
|
900
939
|
get colorBottom(): number;
|
|
@@ -171,6 +171,14 @@ export class CoreNode extends EventEmitter {
|
|
|
171
171
|
hasShaderTimeFn = false;
|
|
172
172
|
hasColorProps = false;
|
|
173
173
|
textureLoaded = false;
|
|
174
|
+
/**
|
|
175
|
+
* True while this node should render its `placeholderColor` instead of its
|
|
176
|
+
* texture: `placeholderColor` is non-zero, a texture is set, and that
|
|
177
|
+
* texture is not loaded. Read by the renderers' quad path to substitute the
|
|
178
|
+
* stage's default (1x1 white) texture. Maintained by
|
|
179
|
+
* {@link updatePlaceholderActive} — never written elsewhere.
|
|
180
|
+
*/
|
|
181
|
+
placeholderActive = false;
|
|
174
182
|
updateType = UpdateType.All;
|
|
175
183
|
childUpdateType = UpdateType.None;
|
|
176
184
|
globalTransform;
|
|
@@ -314,6 +322,26 @@ export class CoreNode extends EventEmitter {
|
|
|
314
322
|
this.updateIsSimple();
|
|
315
323
|
}
|
|
316
324
|
//#region Textures
|
|
325
|
+
/**
|
|
326
|
+
* Recompute {@link placeholderActive} after any of its inputs changed
|
|
327
|
+
* (placeholderColor, texture, textureLoaded).
|
|
328
|
+
*
|
|
329
|
+
* @remarks
|
|
330
|
+
* On a toggle this raises `PremultipliedColors` (the quad's vertex colors
|
|
331
|
+
* switch between the placeholder color and the regular color props — this
|
|
332
|
+
* also marks the quad dirty) and `IsRenderable` (a loading texture with a
|
|
333
|
+
* placeholder is renderable). Both are processed in the same frame's update
|
|
334
|
+
* pass, before quads are submitted.
|
|
335
|
+
*/
|
|
336
|
+
updatePlaceholderActive() {
|
|
337
|
+
const active = this.props.placeholderColor !== 0 &&
|
|
338
|
+
this.props.texture !== null &&
|
|
339
|
+
this.textureLoaded === false;
|
|
340
|
+
if (active !== this.placeholderActive) {
|
|
341
|
+
this.placeholderActive = active;
|
|
342
|
+
this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.IsRenderable);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
317
345
|
loadTexture() {
|
|
318
346
|
if (this.props.texture === null) {
|
|
319
347
|
return;
|
|
@@ -377,6 +405,7 @@ export class CoreNode extends EventEmitter {
|
|
|
377
405
|
this.autosizer.update();
|
|
378
406
|
}
|
|
379
407
|
this.textureLoaded = true;
|
|
408
|
+
this.updatePlaceholderActive();
|
|
380
409
|
this.setUpdateType(UpdateType.IsRenderable);
|
|
381
410
|
// Texture was loaded. In case the RAF loop has already stopped, we request
|
|
382
411
|
// a render to ensure the texture is rendered.
|
|
@@ -403,9 +432,12 @@ export class CoreNode extends EventEmitter {
|
|
|
403
432
|
};
|
|
404
433
|
onTextureFailed = (_, error) => {
|
|
405
434
|
// immediately set isRenderable to false, so that we handle the error
|
|
406
|
-
// without waiting for the next frame loop
|
|
435
|
+
// without waiting for the next frame loop. With a placeholder set, the
|
|
436
|
+
// same frame's update pass recomputes this to true and renders the
|
|
437
|
+
// placeholder instead.
|
|
407
438
|
this.textureLoaded = false;
|
|
408
439
|
this.isRenderable = false;
|
|
440
|
+
this.updatePlaceholderActive();
|
|
409
441
|
this.updateTextureOwnership(false);
|
|
410
442
|
this.setUpdateType(UpdateType.IsRenderable);
|
|
411
443
|
// If parent has a render texture, flag that we need to update
|
|
@@ -422,9 +454,12 @@ export class CoreNode extends EventEmitter {
|
|
|
422
454
|
};
|
|
423
455
|
onTextureFreed = () => {
|
|
424
456
|
// immediately set isRenderable to false, so that we handle the error
|
|
425
|
-
// without waiting for the next frame loop
|
|
457
|
+
// without waiting for the next frame loop. With a placeholder set, the
|
|
458
|
+
// same frame's update pass recomputes this to true and renders the
|
|
459
|
+
// placeholder while the texture reloads.
|
|
426
460
|
this.textureLoaded = false;
|
|
427
461
|
this.isRenderable = false;
|
|
462
|
+
this.updatePlaceholderActive();
|
|
428
463
|
this.updateTextureOwnership(false);
|
|
429
464
|
this.setUpdateType(UpdateType.IsRenderable);
|
|
430
465
|
// If parent has a render texture, flag that we need to update
|
|
@@ -642,7 +677,13 @@ export class CoreNode extends EventEmitter {
|
|
|
642
677
|
}
|
|
643
678
|
this.calculateRenderCoords();
|
|
644
679
|
this.updateBoundingRect();
|
|
645
|
-
|
|
680
|
+
// RecalcUniforms is intentionally NOT set here: shader uniforms are a
|
|
681
|
+
// function of resolvedProps + w/h only (that is exactly the shader
|
|
682
|
+
// value-key cache key), so pure transform changes (translate, scale,
|
|
683
|
+
// rotate) cannot affect them. The flag is raised where w/h actually
|
|
684
|
+
// change: the w/h setters, Autosizer.applyDimensions, text layout
|
|
685
|
+
// application, and the shader setter itself.
|
|
686
|
+
updateType |= UpdateType.RenderState;
|
|
646
687
|
//only propagate children updates if not autosizing
|
|
647
688
|
if ((updateType & UpdateType.Autosize) === 0) {
|
|
648
689
|
updateType |= UpdateType.Children;
|
|
@@ -693,24 +734,37 @@ export class CoreNode extends EventEmitter {
|
|
|
693
734
|
}
|
|
694
735
|
if (updateType & UpdateType.PremultipliedColors) {
|
|
695
736
|
const alpha = this.worldAlpha;
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
this.premultipliedColorBl =
|
|
707
|
-
this.premultipliedColorBr =
|
|
708
|
-
merged;
|
|
737
|
+
if (this.placeholderActive === true) {
|
|
738
|
+
// Placeholder rendering: all four corners take the placeholder color.
|
|
739
|
+
// The quad samples the stage's default 1x1 white texture, so this is
|
|
740
|
+
// exactly the color-rect path.
|
|
741
|
+
const merged = premultiplyColorABGR(props.placeholderColor, alpha);
|
|
742
|
+
this.premultipliedColorTl =
|
|
743
|
+
this.premultipliedColorTr =
|
|
744
|
+
this.premultipliedColorBl =
|
|
745
|
+
this.premultipliedColorBr =
|
|
746
|
+
merged;
|
|
709
747
|
}
|
|
710
748
|
else {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
749
|
+
const tl = props.colorTl;
|
|
750
|
+
const tr = props.colorTr;
|
|
751
|
+
const bl = props.colorBl;
|
|
752
|
+
const br = props.colorBr;
|
|
753
|
+
// Fast equality check (covers all 4 corners)
|
|
754
|
+
const same = tl === tr && tl === bl && tl === br;
|
|
755
|
+
const merged = premultiplyColorABGR(tl, alpha);
|
|
756
|
+
this.premultipliedColorTl = merged;
|
|
757
|
+
if (same === true) {
|
|
758
|
+
this.premultipliedColorTr =
|
|
759
|
+
this.premultipliedColorBl =
|
|
760
|
+
this.premultipliedColorBr =
|
|
761
|
+
merged;
|
|
762
|
+
}
|
|
763
|
+
else {
|
|
764
|
+
this.premultipliedColorTr = premultiplyColorABGR(tr, alpha);
|
|
765
|
+
this.premultipliedColorBl = premultiplyColorABGR(bl, alpha);
|
|
766
|
+
this.premultipliedColorBr = premultiplyColorABGR(br, alpha);
|
|
767
|
+
}
|
|
714
768
|
}
|
|
715
769
|
}
|
|
716
770
|
if (this.renderState === CoreNodeRenderState.OutOfBounds) {
|
|
@@ -947,14 +1001,17 @@ export class CoreNode extends EventEmitter {
|
|
|
947
1001
|
// preemptive check for failed textures this will mark the current node as non-renderable
|
|
948
1002
|
// and will prevent further checks until the texture is reloaded or retry is reset on the texture
|
|
949
1003
|
if (this.texture.retryCount > this.texture.maxRetryCount) {
|
|
950
|
-
// texture has failed to load, we cannot render
|
|
1004
|
+
// texture has failed to load, we cannot render the texture itself —
|
|
1005
|
+
// but a placeholder color still renders in its place
|
|
951
1006
|
this.updateTextureOwnership(false);
|
|
952
|
-
this.setRenderable(
|
|
1007
|
+
this.setRenderable(this.placeholderActive);
|
|
953
1008
|
return;
|
|
954
1009
|
}
|
|
955
1010
|
needsTextureOwnership = true;
|
|
956
|
-
// Use cached boolean instead of string comparison
|
|
957
|
-
|
|
1011
|
+
// Use cached boolean instead of string comparison; a placeholder
|
|
1012
|
+
// renders while the texture is loading
|
|
1013
|
+
newIsRenderable =
|
|
1014
|
+
this.textureLoaded === true || this.placeholderActive === true;
|
|
958
1015
|
}
|
|
959
1016
|
else if (
|
|
960
1017
|
// check shader
|
|
@@ -1184,6 +1241,9 @@ export class CoreNode extends EventEmitter {
|
|
|
1184
1241
|
renderer.addQuad(this);
|
|
1185
1242
|
}
|
|
1186
1243
|
get renderTexture() {
|
|
1244
|
+
if (this.placeholderActive === true) {
|
|
1245
|
+
return this.stage.defaultTexture;
|
|
1246
|
+
}
|
|
1187
1247
|
return this.props.texture || this.stage.defaultTexture;
|
|
1188
1248
|
}
|
|
1189
1249
|
get renderTextureCoords() {
|
|
@@ -1330,7 +1390,9 @@ export class CoreNode extends EventEmitter {
|
|
|
1330
1390
|
const props = this.props;
|
|
1331
1391
|
if (props.w !== value) {
|
|
1332
1392
|
props.w = value;
|
|
1333
|
-
|
|
1393
|
+
// Dimensions feed shader uniforms (e.g. factored corner radius), so a
|
|
1394
|
+
// resize must recompute them; see the Global-update branch in update().
|
|
1395
|
+
let updateType = UpdateType.Local | UpdateType.RecalcUniforms;
|
|
1334
1396
|
if (props.texture !== null &&
|
|
1335
1397
|
this.stage.calculateTextureCoord === true &&
|
|
1336
1398
|
props.textureOptions !== null) {
|
|
@@ -1351,7 +1413,9 @@ export class CoreNode extends EventEmitter {
|
|
|
1351
1413
|
const props = this.props;
|
|
1352
1414
|
if (props.h !== value) {
|
|
1353
1415
|
props.h = value;
|
|
1354
|
-
|
|
1416
|
+
// Dimensions feed shader uniforms (e.g. factored corner radius), so a
|
|
1417
|
+
// resize must recompute them; see the Global-update branch in update().
|
|
1418
|
+
let updateType = UpdateType.Local | UpdateType.RecalcUniforms;
|
|
1355
1419
|
if (props.texture !== null &&
|
|
1356
1420
|
this.stage.calculateTextureCoord === true &&
|
|
1357
1421
|
props.textureOptions !== null) {
|
|
@@ -1557,6 +1621,21 @@ export class CoreNode extends EventEmitter {
|
|
|
1557
1621
|
this.colorRight = value;
|
|
1558
1622
|
this.setUpdateType(UpdateType.PremultipliedColors);
|
|
1559
1623
|
}
|
|
1624
|
+
get placeholderColor() {
|
|
1625
|
+
return this.props.placeholderColor;
|
|
1626
|
+
}
|
|
1627
|
+
set placeholderColor(value) {
|
|
1628
|
+
const p = this.props;
|
|
1629
|
+
if (p.placeholderColor === value)
|
|
1630
|
+
return;
|
|
1631
|
+
p.placeholderColor = value;
|
|
1632
|
+
this.updatePlaceholderActive();
|
|
1633
|
+
// If the placeholder is (still) showing, the new color must reach the
|
|
1634
|
+
// quad buffer even though the active state did not toggle.
|
|
1635
|
+
if (this.placeholderActive === true) {
|
|
1636
|
+
this.setUpdateType(UpdateType.PremultipliedColors);
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1560
1639
|
get colorTop() {
|
|
1561
1640
|
return this.props.colorTop;
|
|
1562
1641
|
}
|
|
@@ -1896,6 +1975,7 @@ export class CoreNode extends EventEmitter {
|
|
|
1896
1975
|
this.textureCoords = undefined;
|
|
1897
1976
|
this.props.texture = value;
|
|
1898
1977
|
this.textureLoaded = value !== null && value.state === 'loaded';
|
|
1978
|
+
this.updatePlaceholderActive();
|
|
1899
1979
|
if (value !== null) {
|
|
1900
1980
|
if (this.autosizer !== null) {
|
|
1901
1981
|
this.autosizer.setMode(AutosizeMode.Texture); // Set to texture size mode
|