@babylonjs/gui 7.6.2 → 7.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1923,7 +1923,7 @@ export class Control {
1923
1923
  this.fontSizeInPixels +
1924
1924
  "px " +
1925
1925
  this._getStyleProperty("fontFamily", "Arial");
1926
- this._fontOffset = Control._GetFontOffset(this._font, this._host.getScene()?.getEngine());
1926
+ this._fontOffset = Control._GetFontOffset(this._font, this._host?.getScene()?.getEngine());
1927
1927
  //children need to be refreshed
1928
1928
  this.getDescendants().forEach((child) => child._markAllAsDirty());
1929
1929
  }
@@ -1 +1 @@
1
- {"version":3,"file":"control.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/control.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,6CAA+B;AAElE,OAAO,EAAE,iBAAiB,EAAE,gDAAkC;AAC9D,OAAO,EAAE,MAAM,EAAE,uCAAyB;AAC1C,OAAO,EAAE,KAAK,EAAE,sCAAwB;AAMxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,0CAA4B;AAC9D,OAAO,EAAE,SAAS,EAAE,2CAA6B;AACjD,OAAO,EAAE,mBAAmB,EAAE,yDAA2C;AAEzE,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAQvD;;;GAGG;AACH,MAAM,OAAO,OAAO;IAmHhB;;;OAGG;IACH,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,IAAW,UAAU,CAAC,KAAc;QAChC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAW,kBAAkB;QACzB,OA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AGX;AA8BD;IADC,SAAS,EAAE;qDAGX;AAgBD;IADC,SAAS,EAAE;0CAGX;AAqCD;IADC,SAAS,EAAE;2CAGX;AAqCD;IADC,SAAS,EAAE;yCAGX;AAqCD;IADC,SAAS,EAAE;4CAGX;AAqCD;IADC,SAAS,EAAE;mCAGX;AA4BD;IADC,SAAS,EAAE;kCAGX;AA4BD;IADC,SAAS,EAAE;0CAGX;AA4BD;IADC,SAAS,EAAE;0CAGX;AAmCD;IADC,SAAS,EAAE;wCAGX;AA6BD;IADC,SAAS,EAAE;4CAGX;AAYD;IADC,SAAS,EAAE;gDAGX;AAkBM;IADN,SAAS,EAAE;6CACiB;AAKtB;IADN,SAAS,EAAE;uDAC2B;AA+5C3C,aAAa,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\n/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Vector2, Vector3, Matrix } from \"core/Maths/math.vector\";\r\nimport type { PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { PointerEventTypes } from \"core/Events/pointerEvents\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nimport type { Container } from \"./container\";\r\nimport type { AdvancedDynamicTexture } from \"../advancedDynamicTexture\";\r\nimport { ValueAndUnit } from \"../valueAndUnit\";\r\nimport { Measure } from \"../measure\";\r\nimport type { Style } from \"../style\";\r\nimport { Matrix2D, Vector2WithInfo } from \"../math2D\";\r\nimport { GetClass, RegisterClass } from \"core/Misc/typeStore\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport type { ICanvasGradient, ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport { EngineStore } from \"core/Engines/engineStore\";\r\nimport type { IAccessibilityTag } from \"core/IAccessibilityTag\";\r\nimport type { IPointerEvent } from \"core/Events/deviceInputEvents\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { Animation } from \"core/Animations/animation\";\r\nimport type { BaseGradient } from \"./gradient/BaseGradient\";\r\nimport type { AbstractEngine } from \"core/Engines/abstractEngine\";\r\n\r\n/**\r\n * Root class used for all 2D controls\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#controls\r\n */\r\nexport class Control implements IAnimatable {\r\n /**\r\n * Gets or sets a boolean indicating if alpha must be an inherited value (false by default)\r\n */\r\n public static AllowAlphaInheritance = false;\r\n\r\n private _alpha = 1;\r\n private _alphaSet = false;\r\n private _zIndex = 0;\r\n /** @internal */\r\n public _host: AdvancedDynamicTexture;\r\n /** Gets or sets the control parent */\r\n public parent: Nullable<Container>;\r\n /** @internal */\r\n public _currentMeasure = Measure.Empty();\r\n /** @internal */\r\n public _tempPaddingMeasure = Measure.Empty();\r\n private _fontFamily = \"\";\r\n private _fontStyle = \"\";\r\n private _fontWeight = \"\";\r\n private _fontSize = new ValueAndUnit(18, ValueAndUnit.UNITMODE_PIXEL, false);\r\n private _font: string;\r\n /** @internal */\r\n public _width = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);\r\n /** @internal */\r\n public _height = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);\r\n /** @internal */\r\n protected _fontOffset: { ascent: number; height: number; descent: number };\r\n private _color = \"\";\r\n private _style: Nullable<Style> = null;\r\n private _styleObserver: Nullable<Observer<Style>>;\r\n /** @internal */\r\n protected _horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n /** @internal */\r\n protected _verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n /** @internal */\r\n protected _isDirty = true;\r\n /** @internal */\r\n protected _wasDirty = false;\r\n /** @internal */\r\n public _tempParentMeasure = Measure.Empty();\r\n /** @internal */\r\n public _prevCurrentMeasureTransformedIntoGlobalSpace = Measure.Empty();\r\n /** @internal */\r\n public _cachedParentMeasure = Measure.Empty();\r\n private _descendantsOnlyPadding = false;\r\n private _paddingLeft = new ValueAndUnit(0);\r\n private _paddingRight = new ValueAndUnit(0);\r\n private _paddingTop = new ValueAndUnit(0);\r\n private _paddingBottom = new ValueAndUnit(0);\r\n /** @internal */\r\n public _left = new ValueAndUnit(0);\r\n /** @internal */\r\n public _top = new ValueAndUnit(0);\r\n private _scaleX = 1.0;\r\n private _scaleY = 1.0;\r\n private _rotation = 0;\r\n private _transformCenterX = 0.5;\r\n private _transformCenterY = 0.5;\r\n /** @internal */\r\n public _transformMatrix = Matrix2D.Identity();\r\n /** @internal */\r\n protected _invertTransformMatrix = Matrix2D.Identity();\r\n /** @internal */\r\n protected _transformedPosition = Vector2.Zero();\r\n private _isMatrixDirty = true;\r\n private _cachedOffsetX: number;\r\n private _cachedOffsetY: number;\r\n private _isVisible = true;\r\n private _isHighlighted = false;\r\n private _highlightColor = \"#4affff\";\r\n protected _highlightLineWidth = 2;\r\n /** @internal */\r\n public _linkedMesh: Nullable<TransformNode>;\r\n private _fontSet = false;\r\n private _dummyVector2 = Vector2.Zero();\r\n private _downCount = 0;\r\n private _enterCount = -1;\r\n private _doNotRender = false;\r\n private _downPointerIds: { [id: number]: boolean } = {};\r\n private _evaluatedMeasure = new Measure(0, 0, 0, 0);\r\n private _evaluatedParentMeasure = new Measure(0, 0, 0, 0);\r\n protected _isEnabled = true;\r\n protected _disabledColor = \"#9a9a9a\";\r\n protected _disabledColorItem = \"#6a6a6a\";\r\n protected _isReadOnly = false;\r\n private _gradient: Nullable<BaseGradient> = null;\r\n /** @internal */\r\n protected _rebuildLayout = false;\r\n\r\n /** @internal */\r\n protected _urlRewriter?: (url: string) => string;\r\n\r\n /**\r\n * Observable that fires when the control's enabled state changes\r\n */\r\n public onEnabledStateChangedObservable = new Observable<boolean>();\r\n\r\n /** @internal */\r\n public _customData: any = {};\r\n\r\n /** @internal */\r\n public _isClipped = false;\r\n\r\n /** @internal */\r\n public _automaticSize = false;\r\n\r\n /** @internal */\r\n public _tag: any;\r\n\r\n /**\r\n * Gets or sets the unique id of the node. Please note that this number will be updated when the control is added to a container\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the control is readonly (default: false).\r\n * A readonly control will still raise pointer events but will not react to them\r\n */\r\n public get isReadOnly() {\r\n return this._isReadOnly;\r\n }\r\n\r\n public set isReadOnly(value: boolean) {\r\n this._isReadOnly = value;\r\n }\r\n\r\n /**\r\n * Gets the transformed measure, that is the bounding box of the control after applying all transformations\r\n */\r\n public get transformedMeasure(): Measure {\r\n return this._evaluatedMeasure;\r\n }\r\n\r\n /**\r\n * Gets or sets an object used to store user defined information for the node\r\n */\r\n @serialize()\r\n public metadata: any = null;\r\n\r\n /** Gets or sets a boolean indicating if the control can be hit with pointer events */\r\n @serialize()\r\n public isHitTestVisible = true;\r\n /** Gets or sets a boolean indicating if the control can block pointer events. False by default except on the following controls:\r\n * * Button controls (Button, RadioButton, ToggleButton)\r\n * * Checkbox\r\n * * ColorPicker\r\n * * InputText\r\n * * Slider\r\n */\r\n @serialize()\r\n public isPointerBlocker = false;\r\n /** Gets or sets a boolean indicating if the control can be focusable */\r\n @serialize()\r\n public isFocusInvisible = false;\r\n\r\n protected _clipChildren = true;\r\n /**\r\n * Sets/Gets a boolean indicating if the children are clipped to the current control bounds.\r\n * Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children\r\n */\r\n public set clipChildren(value: boolean) {\r\n this._clipChildren = value;\r\n }\r\n\r\n @serialize()\r\n public get clipChildren() {\r\n return this._clipChildren;\r\n }\r\n\r\n protected _clipContent = true;\r\n /**\r\n * Sets/Gets a boolean indicating that control content must be clipped\r\n * Please note that not clipping content may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children\r\n */\r\n public set clipContent(value: boolean) {\r\n this._clipContent = value;\r\n }\r\n\r\n @serialize()\r\n public get clipContent() {\r\n return this._clipContent;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that the current control should cache its rendering (useful when the control does not change often)\r\n */\r\n @serialize()\r\n public useBitmapCache = false;\r\n\r\n private _cacheData: Nullable<ImageData>;\r\n\r\n private _shadowOffsetX = 0;\r\n /** Gets or sets a value indicating the offset to apply on X axis to render the shadow */\r\n @serialize()\r\n public get shadowOffsetX() {\r\n return this._shadowOffsetX;\r\n }\r\n\r\n public set shadowOffsetX(value: number) {\r\n if (this._shadowOffsetX === value) {\r\n return;\r\n }\r\n\r\n this._shadowOffsetX = value;\r\n this._markAsDirty();\r\n }\r\n\r\n private _shadowOffsetY = 0;\r\n /** Gets or sets a value indicating the offset to apply on Y axis to render the shadow */\r\n @serialize()\r\n public get shadowOffsetY() {\r\n return this._shadowOffsetY;\r\n }\r\n\r\n public set shadowOffsetY(value: number) {\r\n if (this._shadowOffsetY === value) {\r\n return;\r\n }\r\n\r\n this._shadowOffsetY = value;\r\n this._markAsDirty();\r\n }\r\n\r\n private _shadowBlur = 0;\r\n private _previousShadowBlur = 0;\r\n /** Gets or sets a value indicating the amount of blur to use to render the shadow */\r\n @serialize()\r\n public get shadowBlur() {\r\n return this._shadowBlur;\r\n }\r\n\r\n public set shadowBlur(value: number) {\r\n if (this._shadowBlur === value) {\r\n return;\r\n }\r\n\r\n this._previousShadowBlur = this._shadowBlur;\r\n\r\n this._shadowBlur = value;\r\n this._markAsDirty();\r\n }\r\n\r\n private _shadowColor = \"black\";\r\n /** Gets or sets a value indicating the color of the shadow (black by default ie. \"#000\") */\r\n @serialize()\r\n public get shadowColor() {\r\n return this._shadowColor;\r\n }\r\n\r\n public set shadowColor(value: string) {\r\n if (this._shadowColor === value) {\r\n return;\r\n }\r\n\r\n this._shadowColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the cursor to use when the control is hovered */\r\n @serialize()\r\n public hoverCursor = \"\";\r\n\r\n /** @internal */\r\n protected _linkOffsetX = new ValueAndUnit(0);\r\n /** @internal */\r\n protected _linkOffsetY = new ValueAndUnit(0);\r\n\r\n // Properties\r\n\r\n /** Gets the control type name */\r\n public get typeName(): string {\r\n return this._getTypeName();\r\n }\r\n\r\n /**\r\n * Get the current class name of the control.\r\n * @returns current class name\r\n */\r\n public getClassName(): string {\r\n return this._getTypeName();\r\n }\r\n\r\n /**\r\n * Gets or sets the accessibility tag to describe the control for accessibility purpose.\r\n * By default, GUI controls already indicate accessibility info, but one can override the info using this tag.\r\n */\r\n public set accessibilityTag(value: Nullable<IAccessibilityTag>) {\r\n this._accessibilityTag = value;\r\n this.onAccessibilityTagChangedObservable.notifyObservers(value);\r\n }\r\n\r\n public get accessibilityTag() {\r\n return this._accessibilityTag;\r\n }\r\n\r\n protected _accessibilityTag: Nullable<IAccessibilityTag> = null;\r\n\r\n /**\r\n * Observable that fires whenever the accessibility event of the control has changed\r\n */\r\n public onAccessibilityTagChangedObservable = new Observable<Nullable<IAccessibilityTag>>();\r\n\r\n /**\r\n * An event triggered when pointer wheel is scrolled\r\n */\r\n public onWheelObservable = new Observable<Vector2>();\r\n /**\r\n * An event triggered when the pointer moves over the control.\r\n */\r\n public onPointerMoveObservable = new Observable<Vector2>();\r\n\r\n /**\r\n * An event triggered when the pointer moves out of the control.\r\n */\r\n public onPointerOutObservable = new Observable<Control>();\r\n\r\n /**\r\n * An event triggered when the pointer taps the control\r\n */\r\n public onPointerDownObservable = new Observable<Vector2WithInfo>();\r\n\r\n /**\r\n * An event triggered when pointer up\r\n */\r\n public onPointerUpObservable = new Observable<Vector2WithInfo>();\r\n\r\n /**\r\n * An event triggered when a control is clicked on\r\n */\r\n public onPointerClickObservable = new Observable<Vector2WithInfo>();\r\n\r\n /**\r\n * An event triggered when pointer enters the control\r\n */\r\n public onPointerEnterObservable = new Observable<Control>();\r\n\r\n /**\r\n * An event triggered when the control is marked as dirty\r\n */\r\n public onDirtyObservable = new Observable<Control>();\r\n\r\n /**\r\n * An event triggered before drawing the control\r\n */\r\n public onBeforeDrawObservable = new Observable<Control>();\r\n\r\n /**\r\n * An event triggered after the control was drawn\r\n */\r\n public onAfterDrawObservable = new Observable<Control>();\r\n\r\n /**\r\n * An event triggered when the control has been disposed\r\n */\r\n public onDisposeObservable = new Observable<Control>();\r\n\r\n /**\r\n * An event triggered when the control isVisible is changed\r\n */\r\n public onIsVisibleChangedObservable = new Observable<boolean>();\r\n\r\n /**\r\n * Get the hosting AdvancedDynamicTexture\r\n */\r\n public get host(): AdvancedDynamicTexture {\r\n return this._host;\r\n }\r\n\r\n /** Gets or set information about font offsets (used to render and align text) */\r\n @serialize()\r\n public get fontOffset(): { ascent: number; height: number; descent: number } {\r\n return this._fontOffset;\r\n }\r\n\r\n public set fontOffset(offset: { ascent: number; height: number; descent: number }) {\r\n this._fontOffset = offset;\r\n }\r\n\r\n /** Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent) */\r\n @serialize()\r\n public get alpha(): number {\r\n return this._alpha;\r\n }\r\n\r\n public set alpha(value: number) {\r\n if (this._alpha === value) {\r\n return;\r\n }\r\n this._alphaSet = true;\r\n this._alpha = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a number indicating size of stroke we want to highlight the control with (mostly for debugging purpose)\r\n */\r\n public get highlightLineWidth(): number {\r\n return this._highlightLineWidth;\r\n }\r\n\r\n public set highlightLineWidth(value: number) {\r\n if (this._highlightLineWidth === value) {\r\n return;\r\n }\r\n\r\n this._highlightLineWidth = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)\r\n */\r\n public get isHighlighted(): boolean {\r\n return this._isHighlighted;\r\n }\r\n\r\n public set isHighlighted(value: boolean) {\r\n if (this._isHighlighted === value) {\r\n return;\r\n }\r\n\r\n this._isHighlighted = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Indicates if the control should be serialized. Defaults to true.\r\n */\r\n @serialize()\r\n public isSerializable: boolean = true;\r\n\r\n /**\r\n * Gets or sets a string defining the color to use for highlighting this control\r\n */\r\n public get highlightColor(): string {\r\n return this._highlightColor;\r\n }\r\n\r\n public set highlightColor(value: string) {\r\n if (this._highlightColor === value) {\r\n return;\r\n }\r\n\r\n this._highlightColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a value indicating the scale factor on X axis (1 by default)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling\r\n */\r\n @serialize()\r\n public get scaleX(): number {\r\n return this._scaleX;\r\n }\r\n\r\n public set scaleX(value: number) {\r\n if (this._scaleX === value) {\r\n return;\r\n }\r\n\r\n this._scaleX = value;\r\n this._markAsDirty();\r\n this._markMatrixAsDirty();\r\n }\r\n\r\n /** Gets or sets a value indicating the scale factor on Y axis (1 by default)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling\r\n */\r\n @serialize()\r\n public get scaleY(): number {\r\n return this._scaleY;\r\n }\r\n\r\n public set scaleY(value: number) {\r\n if (this._scaleY === value) {\r\n return;\r\n }\r\n\r\n this._scaleY = value;\r\n this._markAsDirty();\r\n this._markMatrixAsDirty();\r\n }\r\n\r\n /** Gets or sets the rotation angle (0 by default)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling\r\n */\r\n @serialize()\r\n public get rotation(): number {\r\n return this._rotation;\r\n }\r\n\r\n public set rotation(value: number) {\r\n if (this._rotation === value) {\r\n return;\r\n }\r\n\r\n this._rotation = value;\r\n this._markAsDirty();\r\n this._markMatrixAsDirty();\r\n }\r\n\r\n /** Gets or sets the transformation center on Y axis (0 by default)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling\r\n */\r\n @serialize()\r\n public get transformCenterY(): number {\r\n return this._transformCenterY;\r\n }\r\n\r\n public set transformCenterY(value: number) {\r\n if (this._transformCenterY === value) {\r\n return;\r\n }\r\n\r\n this._transformCenterY = value;\r\n this._markAsDirty();\r\n this._markMatrixAsDirty();\r\n }\r\n\r\n /** Gets or sets the transformation center on X axis (0 by default)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling\r\n */\r\n @serialize()\r\n public get transformCenterX(): number {\r\n return this._transformCenterX;\r\n }\r\n\r\n public set transformCenterX(value: number) {\r\n if (this._transformCenterX === value) {\r\n return;\r\n }\r\n\r\n this._transformCenterX = value;\r\n this._markAsDirty();\r\n this._markMatrixAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the horizontal alignment\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#alignments\r\n */\r\n @serialize()\r\n public get horizontalAlignment(): number {\r\n return this._horizontalAlignment;\r\n }\r\n\r\n public set horizontalAlignment(value: number) {\r\n if (this._horizontalAlignment === value) {\r\n return;\r\n }\r\n\r\n this._horizontalAlignment = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the vertical alignment\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#alignments\r\n */\r\n @serialize()\r\n public get verticalAlignment(): number {\r\n return this._verticalAlignment;\r\n }\r\n\r\n public set verticalAlignment(value: number) {\r\n if (this._verticalAlignment === value) {\r\n return;\r\n }\r\n\r\n this._verticalAlignment = value;\r\n this._markAsDirty();\r\n }\r\n\r\n private _fixedRatio = 0;\r\n public set fixedRatio(value: number) {\r\n if (this._fixedRatio === value) {\r\n return;\r\n }\r\n\r\n this._fixedRatio = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a fixed ratio for this control.\r\n * When different from 0, the ratio is used to compute the \"second\" dimension.\r\n * The first dimension used in the computation is the last one set (by setting width / widthInPixels or height / heightInPixels), and the\r\n * second dimension is computed as first dimension * fixedRatio\r\n */\r\n @serialize()\r\n public get fixedRatio(): number {\r\n return this._fixedRatio;\r\n }\r\n\r\n private _fixedRatioMasterIsWidth = true;\r\n set fixedRatioMasterIsWidth(value: boolean) {\r\n if (this._fixedRatioMasterIsWidth === value) {\r\n return;\r\n }\r\n this._fixedRatioMasterIsWidth = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that the fixed ratio is set on the width instead of the height. True by default.\r\n * When the height of a control is set, this property is changed to false.\r\n */\r\n @serialize()\r\n get fixedRatioMasterIsWidth(): boolean {\r\n return this._fixedRatioMasterIsWidth;\r\n }\r\n\r\n /**\r\n * Gets or sets control width\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get width(): string | number {\r\n return this._width.toString(this._host);\r\n }\r\n\r\n public set width(value: string | number) {\r\n this._fixedRatioMasterIsWidth = true;\r\n\r\n if (this._width.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._width.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the control width in pixel\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get widthInPixels(): number {\r\n return this._width.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set widthInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this._fixedRatioMasterIsWidth = true;\r\n this.width = value + \"px\";\r\n }\r\n\r\n /**\r\n * Gets or sets control height\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get height(): string | number {\r\n return this._height.toString(this._host);\r\n }\r\n\r\n public set height(value: string | number) {\r\n this._fixedRatioMasterIsWidth = false;\r\n\r\n if (this._height.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._height.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets control height in pixel\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get heightInPixels(): number {\r\n return this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n public set heightInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this._fixedRatioMasterIsWidth = false;\r\n this.height = value + \"px\";\r\n }\r\n\r\n /** Gets or set font family */\r\n public get fontFamily(): string {\r\n return this._fontFamily;\r\n }\r\n\r\n public set fontFamily(value: string) {\r\n if (this._fontFamily === value) {\r\n return;\r\n }\r\n\r\n this._fontFamily = value;\r\n this._resetFontCache();\r\n }\r\n\r\n /** Gets or sets font style */\r\n public get fontStyle(): string {\r\n return this._fontStyle;\r\n }\r\n\r\n public set fontStyle(value: string) {\r\n if (this._fontStyle === value) {\r\n return;\r\n }\r\n\r\n this._fontStyle = value;\r\n this._resetFontCache();\r\n }\r\n\r\n /** Gets or sets font weight */\r\n public get fontWeight(): string {\r\n return this._fontWeight;\r\n }\r\n\r\n public set fontWeight(value: string) {\r\n if (this._fontWeight === value) {\r\n return;\r\n }\r\n\r\n this._fontWeight = value;\r\n this._resetFontCache();\r\n }\r\n\r\n /**\r\n * Gets or sets style\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#styles\r\n */\r\n @serialize()\r\n public get style(): Nullable<Style> {\r\n return this._style;\r\n }\r\n\r\n public set style(value: Nullable<Style>) {\r\n if (this._style) {\r\n this._style.onChangedObservable.remove(this._styleObserver);\r\n this._styleObserver = null;\r\n }\r\n\r\n this._style = value;\r\n\r\n if (this._style) {\r\n this._styleObserver = this._style.onChangedObservable.add(() => {\r\n this._markAsDirty();\r\n this._resetFontCache();\r\n });\r\n }\r\n\r\n this._markAsDirty();\r\n this._resetFontCache();\r\n }\r\n\r\n /** @internal */\r\n public get _isFontSizeInPercentage(): boolean {\r\n return this._fontSize.isPercentage;\r\n }\r\n\r\n /** Gets or sets font size in pixels */\r\n public get fontSizeInPixels(): number {\r\n const fontSizeToUse = this._style ? this._style._fontSize : this._fontSize;\r\n\r\n if (fontSizeToUse.isPixel) {\r\n return fontSizeToUse.getValue(this._host);\r\n }\r\n\r\n return fontSizeToUse.getValueInPixel(this._host, this._tempParentMeasure.height || this._cachedParentMeasure.height);\r\n }\r\n\r\n public set fontSizeInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.fontSize = value + \"px\";\r\n }\r\n\r\n /** Gets or sets font size */\r\n public get fontSize(): string | number {\r\n return this._fontSize.toString(this._host);\r\n }\r\n\r\n public set fontSize(value: string | number) {\r\n if (this._fontSize.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._fontSize.fromString(value)) {\r\n this._markAsDirty();\r\n this._resetFontCache();\r\n }\r\n }\r\n\r\n /** Gets or sets foreground color */\r\n @serialize()\r\n public get color(): string {\r\n return this._color;\r\n }\r\n\r\n public set color(value: string) {\r\n if (this._color === value) {\r\n return;\r\n }\r\n\r\n this._color = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets gradient. Setting a gradient will override the color */\r\n @serialize()\r\n public get gradient(): Nullable<BaseGradient> {\r\n return this._gradient;\r\n }\r\n\r\n public set gradient(value: Nullable<BaseGradient>) {\r\n if (this._gradient === value) {\r\n return;\r\n }\r\n\r\n this._gradient = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets z index which is used to reorder controls on the z axis */\r\n @serialize()\r\n public get zIndex(): number {\r\n return this._zIndex;\r\n }\r\n\r\n public set zIndex(value: number) {\r\n if (this.zIndex === value) {\r\n return;\r\n }\r\n\r\n this._zIndex = value;\r\n\r\n if (this.parent) {\r\n this.parent._reOrderControl(this);\r\n }\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the control can be rendered */\r\n @serialize()\r\n public get notRenderable(): boolean {\r\n return this._doNotRender;\r\n }\r\n\r\n public set notRenderable(value: boolean) {\r\n if (this._doNotRender === value) {\r\n return;\r\n }\r\n\r\n this._doNotRender = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the control is visible */\r\n @serialize()\r\n public get isVisible(): boolean {\r\n return this._isVisible;\r\n }\r\n\r\n public set isVisible(value: boolean) {\r\n if (this._isVisible === value) {\r\n return;\r\n }\r\n\r\n this._isVisible = value;\r\n this._markAsDirty(true);\r\n\r\n this.onIsVisibleChangedObservable.notifyObservers(value);\r\n }\r\n\r\n /** Gets a boolean indicating that the control needs to update its rendering */\r\n public get isDirty(): boolean {\r\n return this._isDirty;\r\n }\r\n\r\n /**\r\n * Gets the current linked mesh (or null if none)\r\n */\r\n public get linkedMesh(): Nullable<TransformNode> {\r\n return this._linkedMesh;\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding should work like in CSS.\r\n * Basically, it will add the padding amount on each side of the parent control for its children.\r\n */\r\n @serialize()\r\n public get descendantsOnlyPadding(): boolean {\r\n return this._descendantsOnlyPadding;\r\n }\r\n\r\n public set descendantsOnlyPadding(value: boolean) {\r\n if (this._descendantsOnlyPadding === value) {\r\n return;\r\n }\r\n\r\n this._descendantsOnlyPadding = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding to use on the left of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get paddingLeft(): string | number {\r\n return this._paddingLeft.toString(this._host);\r\n }\r\n\r\n public set paddingLeft(value: string | number) {\r\n if (this._paddingLeft.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding in pixels to use on the left of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get paddingLeftInPixels(): number {\r\n return this._paddingLeft.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set paddingLeftInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.paddingLeft = value + \"px\";\r\n }\r\n\r\n /** @internal */\r\n public get _paddingLeftInPixels(): number {\r\n if (this._descendantsOnlyPadding) {\r\n return 0;\r\n }\r\n\r\n return this.paddingLeftInPixels;\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding to use on the right of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get paddingRight(): string | number {\r\n return this._paddingRight.toString(this._host);\r\n }\r\n\r\n public set paddingRight(value: string | number) {\r\n if (this._paddingRight.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding in pixels to use on the right of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get paddingRightInPixels(): number {\r\n return this._paddingRight.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set paddingRightInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.paddingRight = value + \"px\";\r\n }\r\n\r\n /** @internal */\r\n public get _paddingRightInPixels(): number {\r\n if (this._descendantsOnlyPadding) {\r\n return 0;\r\n }\r\n\r\n return this.paddingRightInPixels;\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding to use on the top of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get paddingTop(): string | number {\r\n return this._paddingTop.toString(this._host);\r\n }\r\n\r\n public set paddingTop(value: string | number) {\r\n if (this._paddingTop.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding in pixels to use on the top of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get paddingTopInPixels(): number {\r\n return this._paddingTop.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n public set paddingTopInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.paddingTop = value + \"px\";\r\n }\r\n\r\n /** @internal */\r\n public get _paddingTopInPixels(): number {\r\n if (this._descendantsOnlyPadding) {\r\n return 0;\r\n }\r\n\r\n return this.paddingTopInPixels;\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding to use on the bottom of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get paddingBottom(): string | number {\r\n return this._paddingBottom.toString(this._host);\r\n }\r\n\r\n public set paddingBottom(value: string | number) {\r\n if (this._paddingBottom.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding in pixels to use on the bottom of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get paddingBottomInPixels(): number {\r\n return this._paddingBottom.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n public set paddingBottomInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.paddingBottom = value + \"px\";\r\n }\r\n\r\n /** @internal */\r\n public get _paddingBottomInPixels(): number {\r\n if (this._descendantsOnlyPadding) {\r\n return 0;\r\n }\r\n\r\n return this.paddingBottomInPixels;\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the left coordinate of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get left(): string | number {\r\n return this._left.toString(this._host);\r\n }\r\n\r\n public set left(value: string | number) {\r\n if (this._left.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the left coordinate in pixels of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get leftInPixels(): number {\r\n return this._left.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set leftInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.left = value + \"px\";\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the top coordinate of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get top(): string | number {\r\n return this._top.toString(this._host);\r\n }\r\n\r\n public set top(value: string | number) {\r\n if (this._top.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the top coordinate in pixels of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get topInPixels(): number {\r\n return this._top.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n public set topInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.top = value + \"px\";\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the offset on X axis to the linked mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions\r\n */\r\n @serialize()\r\n public get linkOffsetX(): string | number {\r\n return this._linkOffsetX.toString(this._host);\r\n }\r\n\r\n public set linkOffsetX(value: string | number) {\r\n if (this._linkOffsetX.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the offset in pixels on X axis to the linked mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions\r\n */\r\n public get linkOffsetXInPixels(): number {\r\n return this._linkOffsetX.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set linkOffsetXInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.linkOffsetX = value + \"px\";\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the offset on Y axis to the linked mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions\r\n */\r\n @serialize()\r\n public get linkOffsetY(): string | number {\r\n return this._linkOffsetY.toString(this._host);\r\n }\r\n\r\n public set linkOffsetY(value: string | number) {\r\n if (this._linkOffsetY.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the offset in pixels on Y axis to the linked mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions\r\n */\r\n public get linkOffsetYInPixels(): number {\r\n return this._linkOffsetY.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n public set linkOffsetYInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.linkOffsetY = value + \"px\";\r\n }\r\n\r\n /** Gets the center coordinate on X axis */\r\n public get centerX(): number {\r\n return this._currentMeasure.left + this._currentMeasure.width / 2;\r\n }\r\n\r\n /** Gets the center coordinate on Y axis */\r\n public get centerY(): number {\r\n return this._currentMeasure.top + this._currentMeasure.height / 2;\r\n }\r\n\r\n /** Gets or sets if control is Enabled */\r\n @serialize()\r\n public get isEnabled(): boolean {\r\n return this._isEnabled;\r\n }\r\n\r\n public set isEnabled(value: boolean) {\r\n if (this._isEnabled === value) {\r\n return;\r\n }\r\n\r\n this._isEnabled = value;\r\n this._markAsDirty();\r\n // if this control or any of it's descendants are under a pointer, we need to fire a pointerOut event\r\n const recursivelyFirePointerOut = (control: Control) => {\r\n if (!control.host) {\r\n return;\r\n }\r\n for (const pointer in control.host._lastControlOver) {\r\n if (control === this.host._lastControlOver[pointer]) {\r\n control._onPointerOut(control, null, true);\r\n delete control.host._lastControlOver[pointer];\r\n }\r\n }\r\n if ((control as Container).children !== undefined) {\r\n (control as Container).children.forEach(recursivelyFirePointerOut);\r\n }\r\n };\r\n recursivelyFirePointerOut(this);\r\n this.onEnabledStateChangedObservable.notifyObservers(value);\r\n }\r\n /** Gets or sets background color of control if it's disabled. Only applies to Button class. */\r\n @serialize()\r\n public get disabledColor(): string {\r\n return this._disabledColor;\r\n }\r\n\r\n public set disabledColor(value: string) {\r\n if (this._disabledColor === value) {\r\n return;\r\n }\r\n\r\n this._disabledColor = value;\r\n this._markAsDirty();\r\n }\r\n /** Gets or sets front color of control if it's disabled. Only applies to Checkbox class. */\r\n @serialize()\r\n public get disabledColorItem(): string {\r\n return this._disabledColorItem;\r\n }\r\n\r\n public set disabledColorItem(value: string) {\r\n if (this._disabledColorItem === value) {\r\n return;\r\n }\r\n\r\n this._disabledColorItem = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets/sets the overlap group of the control.\r\n * Controls with overlapGroup set to a number can be deoverlapped.\r\n * Controls with overlapGroup set to undefined are not deoverlapped.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#deoverlapping\r\n */\r\n @serialize()\r\n public overlapGroup?: number;\r\n /**\r\n * Gets/sets the deoverlap movement multiplier\r\n */\r\n @serialize()\r\n public overlapDeltaMultiplier?: number;\r\n\r\n /**\r\n * Array of animations\r\n */\r\n animations: Nullable<Animation[]> = null;\r\n\r\n // Functions\r\n\r\n /**\r\n * Creates a new control\r\n * @param name defines the name of the control\r\n */\r\n constructor(\r\n /** defines the name of the control */\r\n public name?: string\r\n ) {}\r\n\r\n /** @internal */\r\n protected _getTypeName(): string {\r\n return \"Control\";\r\n }\r\n\r\n /**\r\n * Gets the first ascendant in the hierarchy of the given type\r\n * @param className defines the required type\r\n * @returns the ascendant or null if not found\r\n */\r\n public getAscendantOfClass(className: string): Nullable<Control> {\r\n if (!this.parent) {\r\n return null;\r\n }\r\n\r\n if (this.parent.getClassName() === className) {\r\n return this.parent;\r\n }\r\n\r\n return this.parent.getAscendantOfClass(className);\r\n }\r\n\r\n /**\r\n * Mark control element as dirty\r\n * @param force force non visible elements to be marked too\r\n */\r\n public markAsDirty(force = false): void {\r\n this._markAsDirty(force);\r\n }\r\n\r\n /**\r\n * Mark the element and its children as dirty\r\n */\r\n public markAllAsDirty(): void {\r\n this._markAllAsDirty();\r\n }\r\n\r\n /** @internal */\r\n public _resetFontCache(): void {\r\n this._fontSet = true;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Determines if a container is an ascendant of the current control\r\n * @param container defines the container to look for\r\n * @returns true if the container is one of the ascendant of the control\r\n */\r\n public isAscendant(container: Control): boolean {\r\n if (!this.parent) {\r\n return false;\r\n }\r\n\r\n if (this.parent === container) {\r\n return true;\r\n }\r\n\r\n return this.parent.isAscendant(container);\r\n }\r\n\r\n /**\r\n * Gets coordinates in local control space\r\n * @param globalCoordinates defines the coordinates to transform\r\n * @returns the new coordinates in local space\r\n */\r\n public getLocalCoordinates(globalCoordinates: Vector2): Vector2 {\r\n const result = Vector2.Zero();\r\n\r\n this.getLocalCoordinatesToRef(globalCoordinates, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets coordinates in local control space\r\n * @param globalCoordinates defines the coordinates to transform\r\n * @param result defines the target vector2 where to store the result\r\n * @returns the current control\r\n */\r\n public getLocalCoordinatesToRef(globalCoordinates: Vector2, result: Vector2): Control {\r\n result.x = globalCoordinates.x - this._currentMeasure.left;\r\n result.y = globalCoordinates.y - this._currentMeasure.top;\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets coordinates in parent local control space\r\n * @param globalCoordinates defines the coordinates to transform\r\n * @returns the new coordinates in parent local space\r\n */\r\n public getParentLocalCoordinates(globalCoordinates: Vector2): Vector2 {\r\n const result = Vector2.Zero();\r\n\r\n result.x = globalCoordinates.x - this._cachedParentMeasure.left;\r\n result.y = globalCoordinates.y - this._cachedParentMeasure.top;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Move the current control to a vector3 position projected onto the screen.\r\n * @param position defines the target position\r\n * @param scene defines the hosting scene\r\n */\r\n public moveToVector3(position: Vector3, scene: Scene): void {\r\n if (!this._host || this.parent !== this._host._rootContainer) {\r\n Tools.Error(\"Cannot move a control to a vector3 if the control is not at root level\");\r\n return;\r\n }\r\n\r\n this.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n\r\n const globalViewport = this._host._getGlobalViewport();\r\n const projectedPosition = Vector3.Project(position, Matrix.IdentityReadOnly, scene.getTransformMatrix(), globalViewport);\r\n\r\n this._moveToProjectedPosition(projectedPosition);\r\n\r\n if (projectedPosition.z < 0 || projectedPosition.z > 1) {\r\n this.notRenderable = true;\r\n return;\r\n }\r\n this.notRenderable = false;\r\n }\r\n\r\n /**\r\n * Will store all controls that have this control as ascendant in a given array\r\n * @param results defines the array where to store the descendants\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n */\r\n public getDescendantsToRef(results: Control[], directDescendantsOnly: boolean = false, predicate?: (control: Control) => boolean): void {\r\n // Do nothing by default\r\n }\r\n\r\n /**\r\n * Will return all controls that have this control as ascendant\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @returns all child controls\r\n */\r\n public getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[] {\r\n const results: Control[] = [];\r\n\r\n this.getDescendantsToRef(results, directDescendantsOnly, predicate);\r\n\r\n return results;\r\n }\r\n\r\n /**\r\n * Link current control with a target mesh\r\n * @param mesh defines the mesh to link with\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions\r\n */\r\n public linkWithMesh(mesh: Nullable<TransformNode>): void {\r\n if (!this._host || (this.parent && this.parent !== this._host._rootContainer)) {\r\n if (mesh) {\r\n Tools.Error(\"Cannot link a control to a mesh if the control is not at root level\");\r\n }\r\n return;\r\n }\r\n\r\n const index = this._host._linkedControls.indexOf(this);\r\n if (index !== -1) {\r\n this._linkedMesh = mesh;\r\n if (!mesh) {\r\n this._host._linkedControls.splice(index, 1);\r\n }\r\n return;\r\n } else if (!mesh) {\r\n return;\r\n }\r\n\r\n this.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n this._linkedMesh = mesh;\r\n this._host._linkedControls.push(this);\r\n }\r\n\r\n /**\r\n * Shorthand function to set the top, right, bottom, and left padding values on the control.\r\n * @param { string | number} paddingTop - The value of the top padding.\r\n * @param { string | number} paddingRight - The value of the right padding. If omitted, top is used.\r\n * @param { string | number} paddingBottom - The value of the bottom padding. If omitted, top is used.\r\n * @param { string | number} paddingLeft - The value of the left padding. If omitted, right is used.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public setPadding(paddingTop: string | number, paddingRight?: string | number, paddingBottom?: string | number, paddingLeft?: string | number) {\r\n const top = paddingTop;\r\n const right = paddingRight ?? top;\r\n const bottom = paddingBottom ?? top;\r\n const left = paddingLeft ?? right;\r\n\r\n this.paddingTop = top;\r\n this.paddingRight = right;\r\n this.paddingBottom = bottom;\r\n this.paddingLeft = left;\r\n }\r\n\r\n /**\r\n * Shorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.\r\n * @param { number} paddingTop - The value in pixels of the top padding.\r\n * @param { number} paddingRight - The value in pixels of the right padding. If omitted, top is used.\r\n * @param { number} paddingBottom - The value in pixels of the bottom padding. If omitted, top is used.\r\n * @param { number} paddingLeft - The value in pixels of the left padding. If omitted, right is used.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public setPaddingInPixels(paddingTop: number, paddingRight?: number, paddingBottom?: number, paddingLeft?: number) {\r\n const top = paddingTop;\r\n const right = paddingRight ?? top;\r\n const bottom = paddingBottom ?? top;\r\n const left = paddingLeft ?? right;\r\n\r\n this.paddingTopInPixels = top;\r\n this.paddingRightInPixels = right;\r\n this.paddingBottomInPixels = bottom;\r\n this.paddingLeftInPixels = left;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _moveToProjectedPosition(projectedPosition: Vector3): void {\r\n const oldLeft = this._left.getValue(this._host);\r\n const oldTop = this._top.getValue(this._host);\r\n\r\n const parentMeasure = this.parent?._currentMeasure;\r\n if (parentMeasure) {\r\n this._processMeasures(parentMeasure, this._host.getContext());\r\n }\r\n\r\n let newLeft = projectedPosition.x + this._linkOffsetX.getValue(this._host) - this._currentMeasure.width / 2;\r\n let newTop = projectedPosition.y + this._linkOffsetY.getValue(this._host) - this._currentMeasure.height / 2;\r\n\r\n const leftAndTopIgnoreAdaptiveScaling = this._left.ignoreAdaptiveScaling && this._top.ignoreAdaptiveScaling;\r\n if (leftAndTopIgnoreAdaptiveScaling) {\r\n if (Math.abs(newLeft - oldLeft) < 0.5) {\r\n newLeft = oldLeft;\r\n }\r\n\r\n if (Math.abs(newTop - oldTop) < 0.5) {\r\n newTop = oldTop;\r\n }\r\n }\r\n\r\n if (!leftAndTopIgnoreAdaptiveScaling && oldLeft === newLeft && oldTop === newTop) {\r\n return;\r\n }\r\n\r\n this.left = newLeft + \"px\";\r\n this.top = newTop + \"px\";\r\n\r\n this._left.ignoreAdaptiveScaling = true;\r\n this._top.ignoreAdaptiveScaling = true;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _offsetLeft(offset: number) {\r\n this._isDirty = true;\r\n this._currentMeasure.left += offset;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _offsetTop(offset: number) {\r\n this._isDirty = true;\r\n this._currentMeasure.top += offset;\r\n }\r\n\r\n /** @internal */\r\n public _markMatrixAsDirty(): void {\r\n this._isMatrixDirty = true;\r\n this._flagDescendantsAsMatrixDirty();\r\n }\r\n\r\n /** @internal */\r\n public _flagDescendantsAsMatrixDirty(): void {\r\n // No child\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _intersectsRect(rect: Measure, context?: ICanvasRenderingContext) {\r\n // make sure we are transformed correctly before checking intersections. no-op if nothing is dirty.\r\n this._transform(context);\r\n if (this._evaluatedMeasure.left >= rect.left + rect.width) {\r\n return false;\r\n }\r\n\r\n if (this._evaluatedMeasure.top >= rect.top + rect.height) {\r\n return false;\r\n }\r\n\r\n if (this._evaluatedMeasure.left + this._evaluatedMeasure.width <= rect.left) {\r\n return false;\r\n }\r\n\r\n if (this._evaluatedMeasure.top + this._evaluatedMeasure.height <= rect.top) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n protected _computeAdditionalOffsetX() {\r\n return 0;\r\n }\r\n\r\n /** @internal */\r\n protected _computeAdditionalOffsetY() {\r\n return 0;\r\n }\r\n\r\n /** @internal */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public invalidateRect() {\r\n this._transform();\r\n if (this.host && this.host.useInvalidateRectOptimization) {\r\n // Rotate by transform to get the measure transformed to global space\r\n this._currentMeasure.transformToRef(this._transformMatrix, this._tmpMeasureA);\r\n // get the boudning box of the current measure and last frames measure in global space and invalidate it\r\n // the previous measure is used to properly clear a control that is scaled down\r\n Measure.CombineToRef(this._tmpMeasureA, this._prevCurrentMeasureTransformedIntoGlobalSpace, this._tmpMeasureA);\r\n\r\n // Expand rect based on shadows\r\n const shadowOffsetX = this.shadowOffsetX;\r\n const shadowOffsetY = this.shadowOffsetY;\r\n const shadowBlur = Math.max(this._previousShadowBlur, this.shadowBlur);\r\n\r\n const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0);\r\n const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0);\r\n const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0);\r\n const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0);\r\n\r\n const offsetX = this._computeAdditionalOffsetX();\r\n const offsetY = this._computeAdditionalOffsetY();\r\n\r\n this.host.invalidateRect(\r\n Math.floor(this._tmpMeasureA.left + leftShadowOffset - offsetX),\r\n Math.floor(this._tmpMeasureA.top + topShadowOffset - offsetY),\r\n Math.ceil(this._tmpMeasureA.left + this._tmpMeasureA.width + rightShadowOffset + offsetX),\r\n Math.ceil(this._tmpMeasureA.top + this._tmpMeasureA.height + bottomShadowOffset + offsetY)\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _markAsDirty(force = false): void {\r\n if (!this._isVisible && !force) {\r\n return;\r\n }\r\n\r\n this._isDirty = true;\r\n this._markMatrixAsDirty();\r\n\r\n // Redraw only this rectangle\r\n if (this._host) {\r\n this._host.markAsDirty();\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _markAllAsDirty(): void {\r\n this._markAsDirty();\r\n\r\n if (this._font) {\r\n this._prepareFont();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _link(host: AdvancedDynamicTexture): void {\r\n this._host = host;\r\n if (this._host) {\r\n this.uniqueId = this._host.getScene()!.getUniqueId();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _transform(context?: ICanvasRenderingContext): void {\r\n if (!this._isMatrixDirty && this._scaleX === 1 && this._scaleY === 1 && this._rotation === 0) {\r\n return;\r\n }\r\n\r\n // postTranslate\r\n const offsetX = this._currentMeasure.width * this._transformCenterX + this._currentMeasure.left;\r\n const offsetY = this._currentMeasure.height * this._transformCenterY + this._currentMeasure.top;\r\n if (context) {\r\n context.translate(offsetX, offsetY);\r\n\r\n // rotate\r\n context.rotate(this._rotation);\r\n\r\n // scale\r\n context.scale(this._scaleX, this._scaleY);\r\n\r\n // preTranslate\r\n context.translate(-offsetX, -offsetY);\r\n }\r\n // Need to update matrices?\r\n if (this._isMatrixDirty || this._cachedOffsetX !== offsetX || this._cachedOffsetY !== offsetY) {\r\n this._cachedOffsetX = offsetX;\r\n this._cachedOffsetY = offsetY;\r\n this._isMatrixDirty = false;\r\n this._flagDescendantsAsMatrixDirty();\r\n\r\n Matrix2D.ComposeToRef(-offsetX, -offsetY, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._transformMatrix : null, this._transformMatrix);\r\n\r\n this._transformMatrix.invertToRef(this._invertTransformMatrix);\r\n this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _renderHighlight(context: ICanvasRenderingContext): void {\r\n if (!this.isHighlighted) {\r\n return;\r\n }\r\n\r\n context.save();\r\n context.strokeStyle = this._highlightColor;\r\n context.lineWidth = this._highlightLineWidth;\r\n\r\n this._renderHighlightSpecific(context);\r\n context.restore();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _renderHighlightSpecific(context: ICanvasRenderingContext): void {\r\n context.strokeRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n\r\n protected _getColor(context: ICanvasRenderingContext): string | ICanvasGradient {\r\n return this.gradient ? this.gradient.getCanvasGradient(context) : this.color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _applyStates(context: ICanvasRenderingContext): void {\r\n if (this._isFontSizeInPercentage) {\r\n this._fontSet = true;\r\n }\r\n\r\n if (this._host && this._host.useSmallestIdeal && !this._font) {\r\n this._fontSet = true;\r\n }\r\n\r\n if (this._fontSet) {\r\n this._prepareFont();\r\n this._fontSet = false;\r\n }\r\n\r\n if (this._font) {\r\n context.font = this._font;\r\n }\r\n\r\n if (this._color || this.gradient) {\r\n context.fillStyle = this._getColor(context);\r\n }\r\n\r\n if (Control.AllowAlphaInheritance) {\r\n context.globalAlpha *= this._alpha;\r\n } else if (this._alphaSet) {\r\n context.globalAlpha = this.parent && !this.parent.renderToIntermediateTexture ? this.parent.alpha * this._alpha : this._alpha;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _layout(parentMeasure: Measure, context: ICanvasRenderingContext): boolean {\r\n if (!this.isDirty && (!this.isVisible || this.notRenderable)) {\r\n return false;\r\n }\r\n\r\n if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) {\r\n this.host._numLayoutCalls++;\r\n\r\n this._currentMeasure.addAndTransformToRef(\r\n this._transformMatrix,\r\n -this._paddingLeftInPixels | 0,\r\n -this._paddingTopInPixels | 0,\r\n this._paddingRightInPixels | 0,\r\n this._paddingBottomInPixels | 0,\r\n this._prevCurrentMeasureTransformedIntoGlobalSpace\r\n );\r\n\r\n context.save();\r\n\r\n this._applyStates(context);\r\n\r\n let rebuildCount = 0;\r\n do {\r\n this._rebuildLayout = false;\r\n this._processMeasures(parentMeasure, context);\r\n rebuildCount++;\r\n } while (this._rebuildLayout && rebuildCount < 3);\r\n\r\n if (rebuildCount >= 3) {\r\n Logger.Error(`Layout cycle detected in GUI (Control name=${this.name}, uniqueId=${this.uniqueId})`);\r\n }\r\n\r\n context.restore();\r\n this.invalidateRect();\r\n this._evaluateClippingState(parentMeasure);\r\n }\r\n\r\n this._wasDirty = this._isDirty;\r\n this._isDirty = false;\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _processMeasures(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n this._tempPaddingMeasure.copyFrom(parentMeasure);\r\n\r\n // Apply padding if in correct mode\r\n if (this.parent && this.parent.descendantsOnlyPadding) {\r\n this._tempPaddingMeasure.left += this.parent.paddingLeftInPixels;\r\n this._tempPaddingMeasure.top += this.parent.paddingTopInPixels;\r\n this._tempPaddingMeasure.width -= this.parent.paddingLeftInPixels + this.parent.paddingRightInPixels;\r\n this._tempPaddingMeasure.height -= this.parent.paddingTopInPixels + this.parent.paddingBottomInPixels;\r\n }\r\n\r\n this._currentMeasure.copyFrom(this._tempPaddingMeasure);\r\n\r\n // Let children take some pre-measurement actions\r\n this._preMeasure(this._tempPaddingMeasure, context);\r\n\r\n this._measure();\r\n\r\n // Let children take some post-measurement actions\r\n this._postMeasure(this._tempPaddingMeasure, context);\r\n\r\n this._computeAlignment(this._tempPaddingMeasure, context);\r\n\r\n // Convert to int values\r\n this._currentMeasure.left = this._currentMeasure.left | 0;\r\n this._currentMeasure.top = this._currentMeasure.top | 0;\r\n this._currentMeasure.width = this._currentMeasure.width | 0;\r\n this._currentMeasure.height = this._currentMeasure.height | 0;\r\n\r\n // Let children add more features\r\n this._additionalProcessing(this._tempPaddingMeasure, context);\r\n\r\n this._cachedParentMeasure.copyFrom(this._tempPaddingMeasure);\r\n\r\n this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);\r\n if (this.onDirtyObservable.hasObservers()) {\r\n this.onDirtyObservable.notifyObservers(this);\r\n }\r\n }\r\n\r\n protected _evaluateClippingState(parentMeasure: Measure) {\r\n // Since transformMatrix is used here, we need to have it freshly computed\r\n this._transform();\r\n this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);\r\n if (this.parent && this.parent.clipChildren) {\r\n parentMeasure.transformToRef(this.parent._transformMatrix, this._evaluatedParentMeasure);\r\n // Early clip\r\n if (this._evaluatedMeasure.left > this._evaluatedParentMeasure.left + this._evaluatedParentMeasure.width) {\r\n this._isClipped = true;\r\n return;\r\n }\r\n\r\n if (this._evaluatedMeasure.left + this._evaluatedMeasure.width < this._evaluatedParentMeasure.left) {\r\n this._isClipped = true;\r\n return;\r\n }\r\n\r\n if (this._evaluatedMeasure.top > this._evaluatedParentMeasure.top + this._evaluatedParentMeasure.height) {\r\n this._isClipped = true;\r\n return;\r\n }\r\n\r\n if (this._evaluatedMeasure.top + this._evaluatedMeasure.height < this._evaluatedParentMeasure.top) {\r\n this._isClipped = true;\r\n return;\r\n }\r\n }\r\n\r\n this._isClipped = false;\r\n }\r\n\r\n /** @internal */\r\n public _measure(): void {\r\n // Width / Height\r\n if (this._width.isPixel) {\r\n this._currentMeasure.width = this._width.getValue(this._host);\r\n } else {\r\n this._currentMeasure.width *= this._width.getValue(this._host);\r\n }\r\n\r\n if (this._height.isPixel) {\r\n this._currentMeasure.height = this._height.getValue(this._host);\r\n } else {\r\n this._currentMeasure.height *= this._height.getValue(this._host);\r\n }\r\n\r\n if (this._fixedRatio !== 0) {\r\n if (this._fixedRatioMasterIsWidth) {\r\n this._currentMeasure.height = this._currentMeasure.width * this._fixedRatio;\r\n } else {\r\n this._currentMeasure.width = this._currentMeasure.height * this._fixedRatio;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _computeAlignment(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n const width = this._currentMeasure.width;\r\n const height = this._currentMeasure.height;\r\n\r\n const parentWidth = parentMeasure.width;\r\n const parentHeight = parentMeasure.height;\r\n\r\n // Left / top\r\n let x = 0;\r\n let y = 0;\r\n\r\n switch (this.horizontalAlignment) {\r\n case Control.HORIZONTAL_ALIGNMENT_LEFT:\r\n x = 0;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_RIGHT:\r\n x = parentWidth - width;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_CENTER:\r\n x = (parentWidth - width) / 2;\r\n break;\r\n }\r\n\r\n switch (this.verticalAlignment) {\r\n case Control.VERTICAL_ALIGNMENT_TOP:\r\n y = 0;\r\n break;\r\n case Control.VERTICAL_ALIGNMENT_BOTTOM:\r\n y = parentHeight - height;\r\n break;\r\n case Control.VERTICAL_ALIGNMENT_CENTER:\r\n y = (parentHeight - height) / 2;\r\n break;\r\n }\r\n\r\n if (!this.descendantsOnlyPadding) {\r\n if (this._paddingLeft.isPixel) {\r\n this._currentMeasure.left += this._paddingLeft.getValue(this._host);\r\n this._currentMeasure.width -= this._paddingLeft.getValue(this._host);\r\n } else {\r\n this._currentMeasure.left += parentWidth * this._paddingLeft.getValue(this._host);\r\n this._currentMeasure.width -= parentWidth * this._paddingLeft.getValue(this._host);\r\n }\r\n\r\n if (this._paddingRight.isPixel) {\r\n this._currentMeasure.width -= this._paddingRight.getValue(this._host);\r\n } else {\r\n this._currentMeasure.width -= parentWidth * this._paddingRight.getValue(this._host);\r\n }\r\n\r\n if (this._paddingTop.isPixel) {\r\n this._currentMeasure.top += this._paddingTop.getValue(this._host);\r\n this._currentMeasure.height -= this._paddingTop.getValue(this._host);\r\n } else {\r\n this._currentMeasure.top += parentHeight * this._paddingTop.getValue(this._host);\r\n this._currentMeasure.height -= parentHeight * this._paddingTop.getValue(this._host);\r\n }\r\n\r\n if (this._paddingBottom.isPixel) {\r\n this._currentMeasure.height -= this._paddingBottom.getValue(this._host);\r\n } else {\r\n this._currentMeasure.height -= parentHeight * this._paddingBottom.getValue(this._host);\r\n }\r\n }\r\n\r\n if (this._left.isPixel) {\r\n this._currentMeasure.left += this._left.getValue(this._host);\r\n } else {\r\n this._currentMeasure.left += parentWidth * this._left.getValue(this._host);\r\n }\r\n\r\n if (this._top.isPixel) {\r\n this._currentMeasure.top += this._top.getValue(this._host);\r\n } else {\r\n this._currentMeasure.top += parentHeight * this._top.getValue(this._host);\r\n }\r\n\r\n this._currentMeasure.left += x;\r\n this._currentMeasure.top += y;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _preMeasure(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _postMeasure(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _additionalProcessing(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _clipForChildren(context: ICanvasRenderingContext): void {\r\n // DO nothing\r\n }\r\n\r\n private static _ClipMeasure = new Measure(0, 0, 0, 0);\r\n private _tmpMeasureA = new Measure(0, 0, 0, 0);\r\n private _clip(context: ICanvasRenderingContext, invalidatedRectangle?: Nullable<Measure>) {\r\n context.beginPath();\r\n Control._ClipMeasure.copyFrom(this._currentMeasure);\r\n if (invalidatedRectangle) {\r\n // Rotate the invalidated rect into the control's space\r\n invalidatedRectangle.transformToRef(this._invertTransformMatrix, this._tmpMeasureA);\r\n\r\n // Get the intersection of the rect in context space and the current context\r\n const intersection = new Measure(0, 0, 0, 0);\r\n intersection.left = Math.max(this._tmpMeasureA.left, this._currentMeasure.left);\r\n intersection.top = Math.max(this._tmpMeasureA.top, this._currentMeasure.top);\r\n intersection.width = Math.min(this._tmpMeasureA.left + this._tmpMeasureA.width, this._currentMeasure.left + this._currentMeasure.width) - intersection.left;\r\n intersection.height = Math.min(this._tmpMeasureA.top + this._tmpMeasureA.height, this._currentMeasure.top + this._currentMeasure.height) - intersection.top;\r\n Control._ClipMeasure.copyFrom(intersection);\r\n }\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n const shadowOffsetX = this.shadowOffsetX;\r\n const shadowOffsetY = this.shadowOffsetY;\r\n const shadowBlur = this.shadowBlur;\r\n\r\n const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0);\r\n const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0);\r\n const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0);\r\n const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0);\r\n\r\n context.rect(\r\n Control._ClipMeasure.left + leftShadowOffset,\r\n Control._ClipMeasure.top + topShadowOffset,\r\n Control._ClipMeasure.width + rightShadowOffset - leftShadowOffset,\r\n Control._ClipMeasure.height + bottomShadowOffset - topShadowOffset\r\n );\r\n } else {\r\n context.rect(Control._ClipMeasure.left, Control._ClipMeasure.top, Control._ClipMeasure.width, Control._ClipMeasure.height);\r\n }\r\n\r\n context.clip();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _render(context: ICanvasRenderingContext, invalidatedRectangle?: Nullable<Measure>): boolean {\r\n if (!this.isVisible || this.notRenderable || this._isClipped) {\r\n this._isDirty = false;\r\n return false;\r\n }\r\n\r\n this.host._numRenderCalls++;\r\n\r\n context.save();\r\n\r\n this._applyStates(context);\r\n\r\n // Transform\r\n this._transform(context);\r\n\r\n // Clip\r\n if (this.clipContent) {\r\n this._clip(context, invalidatedRectangle);\r\n }\r\n\r\n if (this.onBeforeDrawObservable.hasObservers()) {\r\n this.onBeforeDrawObservable.notifyObservers(this);\r\n }\r\n\r\n if (this.useBitmapCache && !this._wasDirty && this._cacheData) {\r\n context.putImageData(this._cacheData, this._currentMeasure.left, this._currentMeasure.top);\r\n } else {\r\n this._draw(context, invalidatedRectangle);\r\n }\r\n\r\n if (this.useBitmapCache && this._wasDirty) {\r\n this._cacheData = context.getImageData(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n\r\n this._renderHighlight(context);\r\n\r\n if (this.onAfterDrawObservable.hasObservers()) {\r\n this.onAfterDrawObservable.notifyObservers(this);\r\n }\r\n\r\n context.restore();\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _draw(context: ICanvasRenderingContext, invalidatedRectangle?: Nullable<Measure>): void {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * Tests if a given coordinates belong to the current control\r\n * @param x defines x coordinate to test\r\n * @param y defines y coordinate to test\r\n * @returns true if the coordinates are inside the control\r\n */\r\n public contains(x: number, y: number): boolean {\r\n // Invert transform\r\n this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);\r\n\r\n x = this._transformedPosition.x;\r\n y = this._transformedPosition.y;\r\n\r\n // Check\r\n if (x < this._currentMeasure.left) {\r\n return false;\r\n }\r\n\r\n if (x > this._currentMeasure.left + this._currentMeasure.width) {\r\n return false;\r\n }\r\n\r\n if (y < this._currentMeasure.top) {\r\n return false;\r\n }\r\n\r\n if (y > this._currentMeasure.top + this._currentMeasure.height) {\r\n return false;\r\n }\r\n\r\n if (this.isPointerBlocker) {\r\n this._host._shouldBlockPointer = true;\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _processPicking(x: number, y: number, pi: Nullable<PointerInfoBase>, type: number, pointerId: number, buttonIndex: number, deltaX?: number, deltaY?: number): boolean {\r\n if (!this._isEnabled) {\r\n return false;\r\n }\r\n if (!this.isHitTestVisible || !this.isVisible || this._doNotRender) {\r\n return false;\r\n }\r\n\r\n if (!this.contains(x, y)) {\r\n return false;\r\n }\r\n\r\n this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY);\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: Nullable<PointerInfoBase>): void {\r\n const canNotify: boolean = this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this, pi);\r\n\r\n if (canNotify && this.parent != null && !this.isPointerBlocker) {\r\n this.parent._onPointerMove(target, coordinates, pointerId, pi);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerEnter(target: Control, pi: Nullable<PointerInfoBase>): boolean {\r\n if (!this._isEnabled) {\r\n return false;\r\n }\r\n if (this._enterCount > 0) {\r\n return false;\r\n }\r\n\r\n if (this._enterCount === -1) {\r\n // -1 is for touch input, we are now sure we are with a mouse or pencil\r\n this._enterCount = 0;\r\n }\r\n this._enterCount++;\r\n\r\n const canNotify: boolean = this.onPointerEnterObservable.notifyObservers(this, -1, target, this, pi);\r\n\r\n if (canNotify && this.parent != null && !this.isPointerBlocker) {\r\n this.parent._onPointerEnter(target, pi);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerOut(target: Control, pi: Nullable<PointerInfoBase>, force = false): void {\r\n if (!force && (!this._isEnabled || target === this)) {\r\n return;\r\n }\r\n this._enterCount = 0;\r\n\r\n let canNotify: boolean = true;\r\n\r\n if (!target.isAscendant(this)) {\r\n canNotify = this.onPointerOutObservable.notifyObservers(this, -1, target, this, pi);\r\n }\r\n\r\n if (canNotify && this.parent != null && !this.isPointerBlocker) {\r\n this.parent._onPointerOut(target, pi, force);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: Nullable<PointerInfoBase>): boolean {\r\n // Prevent pointerout to lose control context.\r\n // Event redundancy is checked inside the function.\r\n this._onPointerEnter(this, pi);\r\n\r\n if (this._downCount !== 0) {\r\n return false;\r\n }\r\n\r\n this._downCount++;\r\n\r\n this._downPointerIds[pointerId] = true;\r\n\r\n const canNotify: boolean = this.onPointerDownObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);\r\n\r\n if (canNotify && this.parent != null && !this.isPointerBlocker) {\r\n this.parent._onPointerDown(target, coordinates, pointerId, buttonIndex, pi);\r\n }\r\n\r\n if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) {\r\n this._host._capturedPointerIds.add((pi.event as IPointerEvent).pointerId);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean, pi?: Nullable<PointerInfoBase>): void {\r\n if (!this._isEnabled) {\r\n return;\r\n }\r\n this._downCount = 0;\r\n\r\n delete this._downPointerIds[pointerId];\r\n\r\n let canNotifyClick: boolean = notifyClick;\r\n if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) {\r\n canNotifyClick = this.onPointerClickObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);\r\n }\r\n const canNotify: boolean = this.onPointerUpObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);\r\n\r\n if (canNotify && this.parent != null && !this.isPointerBlocker) {\r\n this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex, canNotifyClick, pi);\r\n }\r\n\r\n if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) {\r\n this._host._capturedPointerIds.delete((pi.event as IPointerEvent).pointerId);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _forcePointerUp(pointerId: Nullable<number> = null) {\r\n if (pointerId !== null) {\r\n this._onPointerUp(this, Vector2.Zero(), pointerId, 0, true);\r\n } else {\r\n for (const key in this._downPointerIds) {\r\n this._onPointerUp(this, Vector2.Zero(), +key as number, 0, true);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onWheelScroll(deltaX?: number, deltaY?: number): void {\r\n if (!this._isEnabled) {\r\n return;\r\n }\r\n const canNotify: boolean = this.onWheelObservable.notifyObservers(new Vector2(deltaX, deltaY));\r\n\r\n if (canNotify && this.parent != null) {\r\n this.parent._onWheelScroll(deltaX, deltaY);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _onCanvasBlur(): void {}\r\n\r\n /**\r\n * @internal\r\n */\r\n public _processObservables(\r\n type: number,\r\n x: number,\r\n y: number,\r\n pi: Nullable<PointerInfoBase>,\r\n pointerId: number,\r\n buttonIndex: number,\r\n deltaX?: number,\r\n deltaY?: number\r\n ): boolean {\r\n if (!this._isEnabled) {\r\n return false;\r\n }\r\n this._dummyVector2.copyFromFloats(x, y);\r\n if (type === PointerEventTypes.POINTERMOVE) {\r\n this._onPointerMove(this, this._dummyVector2, pointerId, pi);\r\n\r\n const previousControlOver = this._host._lastControlOver[pointerId];\r\n if (previousControlOver && previousControlOver !== this) {\r\n previousControlOver._onPointerOut(this, pi);\r\n }\r\n\r\n if (previousControlOver !== this) {\r\n this._onPointerEnter(this, pi);\r\n }\r\n\r\n this._host._lastControlOver[pointerId] = this;\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERDOWN) {\r\n this._onPointerDown(this, this._dummyVector2, pointerId, buttonIndex, pi);\r\n this._host._registerLastControlDown(this, pointerId);\r\n this._host._lastPickedControl = this;\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERUP) {\r\n if (this._host._lastControlDown[pointerId]) {\r\n this._host._lastControlDown[pointerId]._onPointerUp(this, this._dummyVector2, pointerId, buttonIndex, true, pi);\r\n }\r\n delete this._host._lastControlDown[pointerId];\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERWHEEL) {\r\n if (this._host._lastControlOver[pointerId]) {\r\n this._host._lastControlOver[pointerId]._onWheelScroll(deltaX, deltaY);\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private _getStyleProperty(propName: \"fontStyle\" | \"fontWeight\" | \"fontFamily\", defaultValue: string): string {\r\n const prop = (this._style && this._style[propName]) ?? this[propName];\r\n if (!prop && this.parent) {\r\n return this.parent._getStyleProperty(propName, defaultValue);\r\n } else if (!this.parent) {\r\n return defaultValue;\r\n } else {\r\n return prop;\r\n }\r\n }\r\n\r\n private _prepareFont() {\r\n if (!this._font && !this._fontSet) {\r\n return;\r\n }\r\n\r\n this._font =\r\n this._getStyleProperty(\"fontStyle\", \"\") +\r\n \" \" +\r\n this._getStyleProperty(\"fontWeight\", \"\") +\r\n \" \" +\r\n this.fontSizeInPixels +\r\n \"px \" +\r\n this._getStyleProperty(\"fontFamily\", \"Arial\");\r\n\r\n this._fontOffset = Control._GetFontOffset(this._font, this._host.getScene()?.getEngine());\r\n\r\n //children need to be refreshed\r\n this.getDescendants().forEach((child) => child._markAllAsDirty());\r\n }\r\n\r\n /**\r\n * A control has a dimension fully defined if that dimension doesn't depend on the parent's dimension.\r\n * As an example, a control that has dimensions in pixels is fully defined, while in percentage is not fully defined.\r\n * @param dim the dimension to check (width or height)\r\n * @returns if the dimension is fully defined\r\n */\r\n public isDimensionFullyDefined(dim: \"width\" | \"height\"): boolean {\r\n return this.getDimension(dim).isPixel;\r\n }\r\n\r\n /**\r\n * Gets the dimension of the control along a specified axis\r\n * @param dim the dimension to retrieve (width or height)\r\n * @returns the dimension value along the specified axis\r\n */\r\n public getDimension(dim: \"width\" | \"height\"): ValueAndUnit {\r\n if (dim === \"width\") {\r\n return this._width;\r\n } else {\r\n return this._height;\r\n }\r\n }\r\n\r\n /**\r\n * Clones a control and its descendants\r\n * @param host the texture where the control will be instantiated. Can be empty, in which case the control will be created on the same texture\r\n * @returns the cloned control\r\n */\r\n public clone(host?: AdvancedDynamicTexture): Control {\r\n const serialization: any = {};\r\n this.serialize(serialization, true);\r\n\r\n const controlType = Tools.Instantiate(\"BABYLON.GUI.\" + serialization.className);\r\n const cloned = new controlType();\r\n cloned.parse(serialization, host);\r\n\r\n return cloned;\r\n }\r\n\r\n /**\r\n * Parses a serialized object into this control\r\n * @param serializedObject the object with the serialized properties\r\n * @param host the texture where the control will be instantiated. Can be empty, in which case the control will be created on the same texture\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @returns this control\r\n */\r\n public parse(serializedObject: any, host?: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): Control {\r\n this._urlRewriter = urlRewriter;\r\n SerializationHelper.Parse(() => this, serializedObject, null);\r\n\r\n this.name = serializedObject.name;\r\n\r\n this._parseFromContent(serializedObject, host ?? this._host);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Serializes the current control\r\n * @param serializationObject defined the JSON serialized object\r\n * @param force if the control should be serialized even if the isSerializable flag is set to false (default false)\r\n * @param allowCanvas defines if the control is allowed to use a Canvas2D object to serialize (true by default)\r\n */\r\n public serialize(serializationObject: any, force: boolean = false, allowCanvas: boolean = true) {\r\n if (!this.isSerializable && !force) {\r\n return;\r\n }\r\n SerializationHelper.Serialize(this, serializationObject);\r\n serializationObject.name = this.name;\r\n serializationObject.className = this.getClassName();\r\n\r\n // Call prepareFont to guarantee the font is properly set before serializing\r\n if (allowCanvas) {\r\n this._prepareFont();\r\n }\r\n if (this._fontFamily) {\r\n serializationObject.fontFamily = this._fontFamily;\r\n }\r\n if (this.fontSize) {\r\n serializationObject.fontSize = this.fontSize;\r\n }\r\n if (this.fontWeight) {\r\n serializationObject.fontWeight = this.fontWeight;\r\n }\r\n if (this.fontStyle) {\r\n serializationObject.fontStyle = this.fontStyle;\r\n }\r\n\r\n if (this._gradient) {\r\n serializationObject.gradient = {};\r\n this._gradient.serialize(serializationObject.gradient);\r\n }\r\n\r\n // Animations\r\n SerializationHelper.AppendSerializedAnimations(this, serializationObject);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _parseFromContent(serializedObject: any, host: AdvancedDynamicTexture, urlRewriter?: (url: string) => string) {\r\n if (serializedObject.fontFamily) {\r\n this.fontFamily = serializedObject.fontFamily;\r\n }\r\n\r\n if (serializedObject.fontSize) {\r\n this.fontSize = serializedObject.fontSize;\r\n }\r\n\r\n if (serializedObject.fontWeight) {\r\n this.fontWeight = serializedObject.fontWeight;\r\n }\r\n\r\n if (serializedObject.fontStyle) {\r\n this.fontStyle = serializedObject.fontStyle;\r\n }\r\n\r\n // Gradient\r\n if (serializedObject.gradient) {\r\n const className = Tools.Instantiate(\"BABYLON.GUI.\" + serializedObject.gradient.className);\r\n this._gradient = new className();\r\n this._gradient?.parse(serializedObject.gradient);\r\n }\r\n\r\n // Animations\r\n if (serializedObject.animations) {\r\n this.animations = [];\r\n for (let animationIndex = 0; animationIndex < serializedObject.animations.length; animationIndex++) {\r\n const parsedAnimation = serializedObject.animations[animationIndex];\r\n const internalClass = GetClass(\"BABYLON.Animation\");\r\n if (internalClass) {\r\n this.animations.push(internalClass.Parse(parsedAnimation));\r\n }\r\n }\r\n\r\n if (serializedObject.autoAnimate && this._host && this._host.getScene()) {\r\n this._host\r\n .getScene()!\r\n .beginAnimation(\r\n this,\r\n serializedObject.autoAnimateFrom,\r\n serializedObject.autoAnimateTo,\r\n serializedObject.autoAnimateLoop,\r\n serializedObject.autoAnimateSpeed || 1.0\r\n );\r\n }\r\n }\r\n\r\n this.fixedRatioMasterIsWidth = serializedObject.fixedRatioMasterIsWidth ?? this.fixedRatioMasterIsWidth;\r\n }\r\n\r\n /** Releases associated resources */\r\n public dispose() {\r\n this.onDirtyObservable.clear();\r\n this.onBeforeDrawObservable.clear();\r\n this.onAfterDrawObservable.clear();\r\n this.onPointerDownObservable.clear();\r\n this.onPointerEnterObservable.clear();\r\n this.onPointerMoveObservable.clear();\r\n this.onPointerOutObservable.clear();\r\n this.onPointerUpObservable.clear();\r\n this.onPointerClickObservable.clear();\r\n this.onWheelObservable.clear();\r\n\r\n if (this._styleObserver && this._style) {\r\n this._style.onChangedObservable.remove(this._styleObserver);\r\n this._styleObserver = null;\r\n }\r\n\r\n if (this.parent) {\r\n this.parent.removeControl(this);\r\n this.parent = null;\r\n }\r\n\r\n if (this._host) {\r\n const index = this._host._linkedControls.indexOf(this);\r\n if (index > -1) {\r\n this.linkWithMesh(null);\r\n }\r\n }\r\n\r\n // Callback\r\n this.onDisposeObservable.notifyObservers(this);\r\n this.onDisposeObservable.clear();\r\n }\r\n\r\n // Statics\r\n private static _HORIZONTAL_ALIGNMENT_LEFT = 0;\r\n private static _HORIZONTAL_ALIGNMENT_RIGHT = 1;\r\n private static _HORIZONTAL_ALIGNMENT_CENTER = 2;\r\n\r\n private static _VERTICAL_ALIGNMENT_TOP = 0;\r\n private static _VERTICAL_ALIGNMENT_BOTTOM = 1;\r\n private static _VERTICAL_ALIGNMENT_CENTER = 2;\r\n\r\n /** HORIZONTAL_ALIGNMENT_LEFT */\r\n public static get HORIZONTAL_ALIGNMENT_LEFT(): number {\r\n return Control._HORIZONTAL_ALIGNMENT_LEFT;\r\n }\r\n\r\n /** HORIZONTAL_ALIGNMENT_RIGHT */\r\n public static get HORIZONTAL_ALIGNMENT_RIGHT(): number {\r\n return Control._HORIZONTAL_ALIGNMENT_RIGHT;\r\n }\r\n\r\n /** HORIZONTAL_ALIGNMENT_CENTER */\r\n public static get HORIZONTAL_ALIGNMENT_CENTER(): number {\r\n return Control._HORIZONTAL_ALIGNMENT_CENTER;\r\n }\r\n\r\n /** VERTICAL_ALIGNMENT_TOP */\r\n public static get VERTICAL_ALIGNMENT_TOP(): number {\r\n return Control._VERTICAL_ALIGNMENT_TOP;\r\n }\r\n\r\n /** VERTICAL_ALIGNMENT_BOTTOM */\r\n public static get VERTICAL_ALIGNMENT_BOTTOM(): number {\r\n return Control._VERTICAL_ALIGNMENT_BOTTOM;\r\n }\r\n\r\n /** VERTICAL_ALIGNMENT_CENTER */\r\n public static get VERTICAL_ALIGNMENT_CENTER(): number {\r\n return Control._VERTICAL_ALIGNMENT_CENTER;\r\n }\r\n\r\n private static _FontHeightSizes: { [key: string]: { ascent: number; height: number; descent: number } } = {};\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _GetFontOffset(font: string, engineToUse?: AbstractEngine): { ascent: number; height: number; descent: number } {\r\n if (Control._FontHeightSizes[font]) {\r\n return Control._FontHeightSizes[font];\r\n }\r\n\r\n const engine = engineToUse || EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n throw new Error(\"Invalid engine. Unable to create a canvas.\");\r\n }\r\n\r\n const result = engine.getFontOffset(font);\r\n Control._FontHeightSizes[font] = result;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a Control from parsed data\r\n * @param serializedObject defines parsed data\r\n * @param host defines the hosting AdvancedDynamicTexture\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @returns a new Control\r\n */\r\n public static Parse(serializedObject: any, host: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): Control {\r\n const controlType = Tools.Instantiate(\"BABYLON.GUI.\" + serializedObject.className);\r\n const control = SerializationHelper.Parse(\r\n () => {\r\n const newControl = new controlType() as Control;\r\n newControl._urlRewriter = urlRewriter;\r\n return newControl;\r\n },\r\n serializedObject,\r\n null\r\n );\r\n\r\n control.name = serializedObject.name;\r\n\r\n control._parseFromContent(serializedObject, host, urlRewriter);\r\n\r\n return control;\r\n }\r\n\r\n public static AddHeader: (control: Control, text: string, size: string | number, options: { isHorizontal: boolean; controlFirst: boolean }) => any = () => {};\r\n\r\n /**\r\n * @internal\r\n */\r\n protected static drawEllipse(x: number, y: number, width: number, height: number, context: ICanvasRenderingContext): void {\r\n context.translate(x, y);\r\n context.scale(width, height);\r\n\r\n context.beginPath();\r\n context.arc(0, 0, 1, 0, 2 * Math.PI);\r\n context.closePath();\r\n\r\n context.scale(1 / width, 1 / height);\r\n context.translate(-x, -y);\r\n }\r\n\r\n /**\r\n * Returns true if the control is ready to be used\r\n * @returns\r\n */\r\n public isReady(): boolean {\r\n // Most controls are ready by default, so the default implementation is to return true\r\n return true;\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.Control\", Control);\r\n"]}
1
+ {"version":3,"file":"control.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/control.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,6CAA+B;AAElE,OAAO,EAAE,iBAAiB,EAAE,gDAAkC;AAC9D,OAAO,EAAE,MAAM,EAAE,uCAAyB;AAC1C,OAAO,EAAE,KAAK,EAAE,sCAAwB;AAMxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,0CAA4B;AAC9D,OAAO,EAAE,SAAS,EAAE,2CAA6B;AACjD,OAAO,EAAE,mBAAmB,EAAE,yDAA2C;AAEzE,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAQvD;;;GAGG;AACH,MAAM,OAAO,OAAO;IAmHhB;;;OAGG;IACH,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,IAAW,UAAU,CAAC,KAAc;QAChC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAW,kBAAkB;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAyBD;;;OAGG;IACH,IAAW,YAAY,CAAC,KAAc;QAClC,IAAI,CAAC,aAAa,GAAG,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EAAE;yCAGX;AAqCD;IADC,SAAS,EAAE;4CAGX;AAqCD;IADC,SAAS,EAAE;mCAGX;AA4BD;IADC,SAAS,EAAE;kCAGX;AA4BD;IADC,SAAS,EAAE;0CAGX;AA4BD;IADC,SAAS,EAAE;0CAGX;AAmCD;IADC,SAAS,EAAE;wCAGX;AA6BD;IADC,SAAS,EAAE;4CAGX;AAYD;IADC,SAAS,EAAE;gDAGX;AAkBM;IADN,SAAS,EAAE;6CACiB;AAKtB;IADN,SAAS,EAAE;uDAC2B;AA+5C3C,aAAa,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\n/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Vector2, Vector3, Matrix } from \"core/Maths/math.vector\";\r\nimport type { PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { PointerEventTypes } from \"core/Events/pointerEvents\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nimport type { Container } from \"./container\";\r\nimport type { AdvancedDynamicTexture } from \"../advancedDynamicTexture\";\r\nimport { ValueAndUnit } from \"../valueAndUnit\";\r\nimport { Measure } from \"../measure\";\r\nimport type { Style } from \"../style\";\r\nimport { Matrix2D, Vector2WithInfo } from \"../math2D\";\r\nimport { GetClass, RegisterClass } from \"core/Misc/typeStore\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport type { ICanvasGradient, ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport { EngineStore } from \"core/Engines/engineStore\";\r\nimport type { IAccessibilityTag } from \"core/IAccessibilityTag\";\r\nimport type { IPointerEvent } from \"core/Events/deviceInputEvents\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { Animation } from \"core/Animations/animation\";\r\nimport type { BaseGradient } from \"./gradient/BaseGradient\";\r\nimport type { AbstractEngine } from \"core/Engines/abstractEngine\";\r\n\r\n/**\r\n * Root class used for all 2D controls\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#controls\r\n */\r\nexport class Control implements IAnimatable {\r\n /**\r\n * Gets or sets a boolean indicating if alpha must be an inherited value (false by default)\r\n */\r\n public static AllowAlphaInheritance = false;\r\n\r\n private _alpha = 1;\r\n private _alphaSet = false;\r\n private _zIndex = 0;\r\n /** @internal */\r\n public _host: AdvancedDynamicTexture;\r\n /** Gets or sets the control parent */\r\n public parent: Nullable<Container>;\r\n /** @internal */\r\n public _currentMeasure = Measure.Empty();\r\n /** @internal */\r\n public _tempPaddingMeasure = Measure.Empty();\r\n private _fontFamily = \"\";\r\n private _fontStyle = \"\";\r\n private _fontWeight = \"\";\r\n private _fontSize = new ValueAndUnit(18, ValueAndUnit.UNITMODE_PIXEL, false);\r\n private _font: string;\r\n /** @internal */\r\n public _width = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);\r\n /** @internal */\r\n public _height = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);\r\n /** @internal */\r\n protected _fontOffset: { ascent: number; height: number; descent: number };\r\n private _color = \"\";\r\n private _style: Nullable<Style> = null;\r\n private _styleObserver: Nullable<Observer<Style>>;\r\n /** @internal */\r\n protected _horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n /** @internal */\r\n protected _verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n /** @internal */\r\n protected _isDirty = true;\r\n /** @internal */\r\n protected _wasDirty = false;\r\n /** @internal */\r\n public _tempParentMeasure = Measure.Empty();\r\n /** @internal */\r\n public _prevCurrentMeasureTransformedIntoGlobalSpace = Measure.Empty();\r\n /** @internal */\r\n public _cachedParentMeasure = Measure.Empty();\r\n private _descendantsOnlyPadding = false;\r\n private _paddingLeft = new ValueAndUnit(0);\r\n private _paddingRight = new ValueAndUnit(0);\r\n private _paddingTop = new ValueAndUnit(0);\r\n private _paddingBottom = new ValueAndUnit(0);\r\n /** @internal */\r\n public _left = new ValueAndUnit(0);\r\n /** @internal */\r\n public _top = new ValueAndUnit(0);\r\n private _scaleX = 1.0;\r\n private _scaleY = 1.0;\r\n private _rotation = 0;\r\n private _transformCenterX = 0.5;\r\n private _transformCenterY = 0.5;\r\n /** @internal */\r\n public _transformMatrix = Matrix2D.Identity();\r\n /** @internal */\r\n protected _invertTransformMatrix = Matrix2D.Identity();\r\n /** @internal */\r\n protected _transformedPosition = Vector2.Zero();\r\n private _isMatrixDirty = true;\r\n private _cachedOffsetX: number;\r\n private _cachedOffsetY: number;\r\n private _isVisible = true;\r\n private _isHighlighted = false;\r\n private _highlightColor = \"#4affff\";\r\n protected _highlightLineWidth = 2;\r\n /** @internal */\r\n public _linkedMesh: Nullable<TransformNode>;\r\n private _fontSet = false;\r\n private _dummyVector2 = Vector2.Zero();\r\n private _downCount = 0;\r\n private _enterCount = -1;\r\n private _doNotRender = false;\r\n private _downPointerIds: { [id: number]: boolean } = {};\r\n private _evaluatedMeasure = new Measure(0, 0, 0, 0);\r\n private _evaluatedParentMeasure = new Measure(0, 0, 0, 0);\r\n protected _isEnabled = true;\r\n protected _disabledColor = \"#9a9a9a\";\r\n protected _disabledColorItem = \"#6a6a6a\";\r\n protected _isReadOnly = false;\r\n private _gradient: Nullable<BaseGradient> = null;\r\n /** @internal */\r\n protected _rebuildLayout = false;\r\n\r\n /** @internal */\r\n protected _urlRewriter?: (url: string) => string;\r\n\r\n /**\r\n * Observable that fires when the control's enabled state changes\r\n */\r\n public onEnabledStateChangedObservable = new Observable<boolean>();\r\n\r\n /** @internal */\r\n public _customData: any = {};\r\n\r\n /** @internal */\r\n public _isClipped = false;\r\n\r\n /** @internal */\r\n public _automaticSize = false;\r\n\r\n /** @internal */\r\n public _tag: any;\r\n\r\n /**\r\n * Gets or sets the unique id of the node. Please note that this number will be updated when the control is added to a container\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the control is readonly (default: false).\r\n * A readonly control will still raise pointer events but will not react to them\r\n */\r\n public get isReadOnly() {\r\n return this._isReadOnly;\r\n }\r\n\r\n public set isReadOnly(value: boolean) {\r\n this._isReadOnly = value;\r\n }\r\n\r\n /**\r\n * Gets the transformed measure, that is the bounding box of the control after applying all transformations\r\n */\r\n public get transformedMeasure(): Measure {\r\n return this._evaluatedMeasure;\r\n }\r\n\r\n /**\r\n * Gets or sets an object used to store user defined information for the node\r\n */\r\n @serialize()\r\n public metadata: any = null;\r\n\r\n /** Gets or sets a boolean indicating if the control can be hit with pointer events */\r\n @serialize()\r\n public isHitTestVisible = true;\r\n /** Gets or sets a boolean indicating if the control can block pointer events. False by default except on the following controls:\r\n * * Button controls (Button, RadioButton, ToggleButton)\r\n * * Checkbox\r\n * * ColorPicker\r\n * * InputText\r\n * * Slider\r\n */\r\n @serialize()\r\n public isPointerBlocker = false;\r\n /** Gets or sets a boolean indicating if the control can be focusable */\r\n @serialize()\r\n public isFocusInvisible = false;\r\n\r\n protected _clipChildren = true;\r\n /**\r\n * Sets/Gets a boolean indicating if the children are clipped to the current control bounds.\r\n * Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children\r\n */\r\n public set clipChildren(value: boolean) {\r\n this._clipChildren = value;\r\n }\r\n\r\n @serialize()\r\n public get clipChildren() {\r\n return this._clipChildren;\r\n }\r\n\r\n protected _clipContent = true;\r\n /**\r\n * Sets/Gets a boolean indicating that control content must be clipped\r\n * Please note that not clipping content may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children\r\n */\r\n public set clipContent(value: boolean) {\r\n this._clipContent = value;\r\n }\r\n\r\n @serialize()\r\n public get clipContent() {\r\n return this._clipContent;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that the current control should cache its rendering (useful when the control does not change often)\r\n */\r\n @serialize()\r\n public useBitmapCache = false;\r\n\r\n private _cacheData: Nullable<ImageData>;\r\n\r\n private _shadowOffsetX = 0;\r\n /** Gets or sets a value indicating the offset to apply on X axis to render the shadow */\r\n @serialize()\r\n public get shadowOffsetX() {\r\n return this._shadowOffsetX;\r\n }\r\n\r\n public set shadowOffsetX(value: number) {\r\n if (this._shadowOffsetX === value) {\r\n return;\r\n }\r\n\r\n this._shadowOffsetX = value;\r\n this._markAsDirty();\r\n }\r\n\r\n private _shadowOffsetY = 0;\r\n /** Gets or sets a value indicating the offset to apply on Y axis to render the shadow */\r\n @serialize()\r\n public get shadowOffsetY() {\r\n return this._shadowOffsetY;\r\n }\r\n\r\n public set shadowOffsetY(value: number) {\r\n if (this._shadowOffsetY === value) {\r\n return;\r\n }\r\n\r\n this._shadowOffsetY = value;\r\n this._markAsDirty();\r\n }\r\n\r\n private _shadowBlur = 0;\r\n private _previousShadowBlur = 0;\r\n /** Gets or sets a value indicating the amount of blur to use to render the shadow */\r\n @serialize()\r\n public get shadowBlur() {\r\n return this._shadowBlur;\r\n }\r\n\r\n public set shadowBlur(value: number) {\r\n if (this._shadowBlur === value) {\r\n return;\r\n }\r\n\r\n this._previousShadowBlur = this._shadowBlur;\r\n\r\n this._shadowBlur = value;\r\n this._markAsDirty();\r\n }\r\n\r\n private _shadowColor = \"black\";\r\n /** Gets or sets a value indicating the color of the shadow (black by default ie. \"#000\") */\r\n @serialize()\r\n public get shadowColor() {\r\n return this._shadowColor;\r\n }\r\n\r\n public set shadowColor(value: string) {\r\n if (this._shadowColor === value) {\r\n return;\r\n }\r\n\r\n this._shadowColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the cursor to use when the control is hovered */\r\n @serialize()\r\n public hoverCursor = \"\";\r\n\r\n /** @internal */\r\n protected _linkOffsetX = new ValueAndUnit(0);\r\n /** @internal */\r\n protected _linkOffsetY = new ValueAndUnit(0);\r\n\r\n // Properties\r\n\r\n /** Gets the control type name */\r\n public get typeName(): string {\r\n return this._getTypeName();\r\n }\r\n\r\n /**\r\n * Get the current class name of the control.\r\n * @returns current class name\r\n */\r\n public getClassName(): string {\r\n return this._getTypeName();\r\n }\r\n\r\n /**\r\n * Gets or sets the accessibility tag to describe the control for accessibility purpose.\r\n * By default, GUI controls already indicate accessibility info, but one can override the info using this tag.\r\n */\r\n public set accessibilityTag(value: Nullable<IAccessibilityTag>) {\r\n this._accessibilityTag = value;\r\n this.onAccessibilityTagChangedObservable.notifyObservers(value);\r\n }\r\n\r\n public get accessibilityTag() {\r\n return this._accessibilityTag;\r\n }\r\n\r\n protected _accessibilityTag: Nullable<IAccessibilityTag> = null;\r\n\r\n /**\r\n * Observable that fires whenever the accessibility event of the control has changed\r\n */\r\n public onAccessibilityTagChangedObservable = new Observable<Nullable<IAccessibilityTag>>();\r\n\r\n /**\r\n * An event triggered when pointer wheel is scrolled\r\n */\r\n public onWheelObservable = new Observable<Vector2>();\r\n /**\r\n * An event triggered when the pointer moves over the control.\r\n */\r\n public onPointerMoveObservable = new Observable<Vector2>();\r\n\r\n /**\r\n * An event triggered when the pointer moves out of the control.\r\n */\r\n public onPointerOutObservable = new Observable<Control>();\r\n\r\n /**\r\n * An event triggered when the pointer taps the control\r\n */\r\n public onPointerDownObservable = new Observable<Vector2WithInfo>();\r\n\r\n /**\r\n * An event triggered when pointer up\r\n */\r\n public onPointerUpObservable = new Observable<Vector2WithInfo>();\r\n\r\n /**\r\n * An event triggered when a control is clicked on\r\n */\r\n public onPointerClickObservable = new Observable<Vector2WithInfo>();\r\n\r\n /**\r\n * An event triggered when pointer enters the control\r\n */\r\n public onPointerEnterObservable = new Observable<Control>();\r\n\r\n /**\r\n * An event triggered when the control is marked as dirty\r\n */\r\n public onDirtyObservable = new Observable<Control>();\r\n\r\n /**\r\n * An event triggered before drawing the control\r\n */\r\n public onBeforeDrawObservable = new Observable<Control>();\r\n\r\n /**\r\n * An event triggered after the control was drawn\r\n */\r\n public onAfterDrawObservable = new Observable<Control>();\r\n\r\n /**\r\n * An event triggered when the control has been disposed\r\n */\r\n public onDisposeObservable = new Observable<Control>();\r\n\r\n /**\r\n * An event triggered when the control isVisible is changed\r\n */\r\n public onIsVisibleChangedObservable = new Observable<boolean>();\r\n\r\n /**\r\n * Get the hosting AdvancedDynamicTexture\r\n */\r\n public get host(): AdvancedDynamicTexture {\r\n return this._host;\r\n }\r\n\r\n /** Gets or set information about font offsets (used to render and align text) */\r\n @serialize()\r\n public get fontOffset(): { ascent: number; height: number; descent: number } {\r\n return this._fontOffset;\r\n }\r\n\r\n public set fontOffset(offset: { ascent: number; height: number; descent: number }) {\r\n this._fontOffset = offset;\r\n }\r\n\r\n /** Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent) */\r\n @serialize()\r\n public get alpha(): number {\r\n return this._alpha;\r\n }\r\n\r\n public set alpha(value: number) {\r\n if (this._alpha === value) {\r\n return;\r\n }\r\n this._alphaSet = true;\r\n this._alpha = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a number indicating size of stroke we want to highlight the control with (mostly for debugging purpose)\r\n */\r\n public get highlightLineWidth(): number {\r\n return this._highlightLineWidth;\r\n }\r\n\r\n public set highlightLineWidth(value: number) {\r\n if (this._highlightLineWidth === value) {\r\n return;\r\n }\r\n\r\n this._highlightLineWidth = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)\r\n */\r\n public get isHighlighted(): boolean {\r\n return this._isHighlighted;\r\n }\r\n\r\n public set isHighlighted(value: boolean) {\r\n if (this._isHighlighted === value) {\r\n return;\r\n }\r\n\r\n this._isHighlighted = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Indicates if the control should be serialized. Defaults to true.\r\n */\r\n @serialize()\r\n public isSerializable: boolean = true;\r\n\r\n /**\r\n * Gets or sets a string defining the color to use for highlighting this control\r\n */\r\n public get highlightColor(): string {\r\n return this._highlightColor;\r\n }\r\n\r\n public set highlightColor(value: string) {\r\n if (this._highlightColor === value) {\r\n return;\r\n }\r\n\r\n this._highlightColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a value indicating the scale factor on X axis (1 by default)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling\r\n */\r\n @serialize()\r\n public get scaleX(): number {\r\n return this._scaleX;\r\n }\r\n\r\n public set scaleX(value: number) {\r\n if (this._scaleX === value) {\r\n return;\r\n }\r\n\r\n this._scaleX = value;\r\n this._markAsDirty();\r\n this._markMatrixAsDirty();\r\n }\r\n\r\n /** Gets or sets a value indicating the scale factor on Y axis (1 by default)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling\r\n */\r\n @serialize()\r\n public get scaleY(): number {\r\n return this._scaleY;\r\n }\r\n\r\n public set scaleY(value: number) {\r\n if (this._scaleY === value) {\r\n return;\r\n }\r\n\r\n this._scaleY = value;\r\n this._markAsDirty();\r\n this._markMatrixAsDirty();\r\n }\r\n\r\n /** Gets or sets the rotation angle (0 by default)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling\r\n */\r\n @serialize()\r\n public get rotation(): number {\r\n return this._rotation;\r\n }\r\n\r\n public set rotation(value: number) {\r\n if (this._rotation === value) {\r\n return;\r\n }\r\n\r\n this._rotation = value;\r\n this._markAsDirty();\r\n this._markMatrixAsDirty();\r\n }\r\n\r\n /** Gets or sets the transformation center on Y axis (0 by default)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling\r\n */\r\n @serialize()\r\n public get transformCenterY(): number {\r\n return this._transformCenterY;\r\n }\r\n\r\n public set transformCenterY(value: number) {\r\n if (this._transformCenterY === value) {\r\n return;\r\n }\r\n\r\n this._transformCenterY = value;\r\n this._markAsDirty();\r\n this._markMatrixAsDirty();\r\n }\r\n\r\n /** Gets or sets the transformation center on X axis (0 by default)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#rotation-and-scaling\r\n */\r\n @serialize()\r\n public get transformCenterX(): number {\r\n return this._transformCenterX;\r\n }\r\n\r\n public set transformCenterX(value: number) {\r\n if (this._transformCenterX === value) {\r\n return;\r\n }\r\n\r\n this._transformCenterX = value;\r\n this._markAsDirty();\r\n this._markMatrixAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the horizontal alignment\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#alignments\r\n */\r\n @serialize()\r\n public get horizontalAlignment(): number {\r\n return this._horizontalAlignment;\r\n }\r\n\r\n public set horizontalAlignment(value: number) {\r\n if (this._horizontalAlignment === value) {\r\n return;\r\n }\r\n\r\n this._horizontalAlignment = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the vertical alignment\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#alignments\r\n */\r\n @serialize()\r\n public get verticalAlignment(): number {\r\n return this._verticalAlignment;\r\n }\r\n\r\n public set verticalAlignment(value: number) {\r\n if (this._verticalAlignment === value) {\r\n return;\r\n }\r\n\r\n this._verticalAlignment = value;\r\n this._markAsDirty();\r\n }\r\n\r\n private _fixedRatio = 0;\r\n public set fixedRatio(value: number) {\r\n if (this._fixedRatio === value) {\r\n return;\r\n }\r\n\r\n this._fixedRatio = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a fixed ratio for this control.\r\n * When different from 0, the ratio is used to compute the \"second\" dimension.\r\n * The first dimension used in the computation is the last one set (by setting width / widthInPixels or height / heightInPixels), and the\r\n * second dimension is computed as first dimension * fixedRatio\r\n */\r\n @serialize()\r\n public get fixedRatio(): number {\r\n return this._fixedRatio;\r\n }\r\n\r\n private _fixedRatioMasterIsWidth = true;\r\n set fixedRatioMasterIsWidth(value: boolean) {\r\n if (this._fixedRatioMasterIsWidth === value) {\r\n return;\r\n }\r\n this._fixedRatioMasterIsWidth = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating that the fixed ratio is set on the width instead of the height. True by default.\r\n * When the height of a control is set, this property is changed to false.\r\n */\r\n @serialize()\r\n get fixedRatioMasterIsWidth(): boolean {\r\n return this._fixedRatioMasterIsWidth;\r\n }\r\n\r\n /**\r\n * Gets or sets control width\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get width(): string | number {\r\n return this._width.toString(this._host);\r\n }\r\n\r\n public set width(value: string | number) {\r\n this._fixedRatioMasterIsWidth = true;\r\n\r\n if (this._width.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._width.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the control width in pixel\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get widthInPixels(): number {\r\n return this._width.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set widthInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this._fixedRatioMasterIsWidth = true;\r\n this.width = value + \"px\";\r\n }\r\n\r\n /**\r\n * Gets or sets control height\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get height(): string | number {\r\n return this._height.toString(this._host);\r\n }\r\n\r\n public set height(value: string | number) {\r\n this._fixedRatioMasterIsWidth = false;\r\n\r\n if (this._height.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._height.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets control height in pixel\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get heightInPixels(): number {\r\n return this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n public set heightInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this._fixedRatioMasterIsWidth = false;\r\n this.height = value + \"px\";\r\n }\r\n\r\n /** Gets or set font family */\r\n public get fontFamily(): string {\r\n return this._fontFamily;\r\n }\r\n\r\n public set fontFamily(value: string) {\r\n if (this._fontFamily === value) {\r\n return;\r\n }\r\n\r\n this._fontFamily = value;\r\n this._resetFontCache();\r\n }\r\n\r\n /** Gets or sets font style */\r\n public get fontStyle(): string {\r\n return this._fontStyle;\r\n }\r\n\r\n public set fontStyle(value: string) {\r\n if (this._fontStyle === value) {\r\n return;\r\n }\r\n\r\n this._fontStyle = value;\r\n this._resetFontCache();\r\n }\r\n\r\n /** Gets or sets font weight */\r\n public get fontWeight(): string {\r\n return this._fontWeight;\r\n }\r\n\r\n public set fontWeight(value: string) {\r\n if (this._fontWeight === value) {\r\n return;\r\n }\r\n\r\n this._fontWeight = value;\r\n this._resetFontCache();\r\n }\r\n\r\n /**\r\n * Gets or sets style\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#styles\r\n */\r\n @serialize()\r\n public get style(): Nullable<Style> {\r\n return this._style;\r\n }\r\n\r\n public set style(value: Nullable<Style>) {\r\n if (this._style) {\r\n this._style.onChangedObservable.remove(this._styleObserver);\r\n this._styleObserver = null;\r\n }\r\n\r\n this._style = value;\r\n\r\n if (this._style) {\r\n this._styleObserver = this._style.onChangedObservable.add(() => {\r\n this._markAsDirty();\r\n this._resetFontCache();\r\n });\r\n }\r\n\r\n this._markAsDirty();\r\n this._resetFontCache();\r\n }\r\n\r\n /** @internal */\r\n public get _isFontSizeInPercentage(): boolean {\r\n return this._fontSize.isPercentage;\r\n }\r\n\r\n /** Gets or sets font size in pixels */\r\n public get fontSizeInPixels(): number {\r\n const fontSizeToUse = this._style ? this._style._fontSize : this._fontSize;\r\n\r\n if (fontSizeToUse.isPixel) {\r\n return fontSizeToUse.getValue(this._host);\r\n }\r\n\r\n return fontSizeToUse.getValueInPixel(this._host, this._tempParentMeasure.height || this._cachedParentMeasure.height);\r\n }\r\n\r\n public set fontSizeInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.fontSize = value + \"px\";\r\n }\r\n\r\n /** Gets or sets font size */\r\n public get fontSize(): string | number {\r\n return this._fontSize.toString(this._host);\r\n }\r\n\r\n public set fontSize(value: string | number) {\r\n if (this._fontSize.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._fontSize.fromString(value)) {\r\n this._markAsDirty();\r\n this._resetFontCache();\r\n }\r\n }\r\n\r\n /** Gets or sets foreground color */\r\n @serialize()\r\n public get color(): string {\r\n return this._color;\r\n }\r\n\r\n public set color(value: string) {\r\n if (this._color === value) {\r\n return;\r\n }\r\n\r\n this._color = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets gradient. Setting a gradient will override the color */\r\n @serialize()\r\n public get gradient(): Nullable<BaseGradient> {\r\n return this._gradient;\r\n }\r\n\r\n public set gradient(value: Nullable<BaseGradient>) {\r\n if (this._gradient === value) {\r\n return;\r\n }\r\n\r\n this._gradient = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets z index which is used to reorder controls on the z axis */\r\n @serialize()\r\n public get zIndex(): number {\r\n return this._zIndex;\r\n }\r\n\r\n public set zIndex(value: number) {\r\n if (this.zIndex === value) {\r\n return;\r\n }\r\n\r\n this._zIndex = value;\r\n\r\n if (this.parent) {\r\n this.parent._reOrderControl(this);\r\n }\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the control can be rendered */\r\n @serialize()\r\n public get notRenderable(): boolean {\r\n return this._doNotRender;\r\n }\r\n\r\n public set notRenderable(value: boolean) {\r\n if (this._doNotRender === value) {\r\n return;\r\n }\r\n\r\n this._doNotRender = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the control is visible */\r\n @serialize()\r\n public get isVisible(): boolean {\r\n return this._isVisible;\r\n }\r\n\r\n public set isVisible(value: boolean) {\r\n if (this._isVisible === value) {\r\n return;\r\n }\r\n\r\n this._isVisible = value;\r\n this._markAsDirty(true);\r\n\r\n this.onIsVisibleChangedObservable.notifyObservers(value);\r\n }\r\n\r\n /** Gets a boolean indicating that the control needs to update its rendering */\r\n public get isDirty(): boolean {\r\n return this._isDirty;\r\n }\r\n\r\n /**\r\n * Gets the current linked mesh (or null if none)\r\n */\r\n public get linkedMesh(): Nullable<TransformNode> {\r\n return this._linkedMesh;\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding should work like in CSS.\r\n * Basically, it will add the padding amount on each side of the parent control for its children.\r\n */\r\n @serialize()\r\n public get descendantsOnlyPadding(): boolean {\r\n return this._descendantsOnlyPadding;\r\n }\r\n\r\n public set descendantsOnlyPadding(value: boolean) {\r\n if (this._descendantsOnlyPadding === value) {\r\n return;\r\n }\r\n\r\n this._descendantsOnlyPadding = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding to use on the left of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get paddingLeft(): string | number {\r\n return this._paddingLeft.toString(this._host);\r\n }\r\n\r\n public set paddingLeft(value: string | number) {\r\n if (this._paddingLeft.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding in pixels to use on the left of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get paddingLeftInPixels(): number {\r\n return this._paddingLeft.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set paddingLeftInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.paddingLeft = value + \"px\";\r\n }\r\n\r\n /** @internal */\r\n public get _paddingLeftInPixels(): number {\r\n if (this._descendantsOnlyPadding) {\r\n return 0;\r\n }\r\n\r\n return this.paddingLeftInPixels;\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding to use on the right of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get paddingRight(): string | number {\r\n return this._paddingRight.toString(this._host);\r\n }\r\n\r\n public set paddingRight(value: string | number) {\r\n if (this._paddingRight.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding in pixels to use on the right of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get paddingRightInPixels(): number {\r\n return this._paddingRight.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set paddingRightInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.paddingRight = value + \"px\";\r\n }\r\n\r\n /** @internal */\r\n public get _paddingRightInPixels(): number {\r\n if (this._descendantsOnlyPadding) {\r\n return 0;\r\n }\r\n\r\n return this.paddingRightInPixels;\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding to use on the top of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get paddingTop(): string | number {\r\n return this._paddingTop.toString(this._host);\r\n }\r\n\r\n public set paddingTop(value: string | number) {\r\n if (this._paddingTop.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding in pixels to use on the top of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get paddingTopInPixels(): number {\r\n return this._paddingTop.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n public set paddingTopInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.paddingTop = value + \"px\";\r\n }\r\n\r\n /** @internal */\r\n public get _paddingTopInPixels(): number {\r\n if (this._descendantsOnlyPadding) {\r\n return 0;\r\n }\r\n\r\n return this.paddingTopInPixels;\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding to use on the bottom of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get paddingBottom(): string | number {\r\n return this._paddingBottom.toString(this._host);\r\n }\r\n\r\n public set paddingBottom(value: string | number) {\r\n if (this._paddingBottom.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the padding in pixels to use on the bottom of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get paddingBottomInPixels(): number {\r\n return this._paddingBottom.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n public set paddingBottomInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.paddingBottom = value + \"px\";\r\n }\r\n\r\n /** @internal */\r\n public get _paddingBottomInPixels(): number {\r\n if (this._descendantsOnlyPadding) {\r\n return 0;\r\n }\r\n\r\n return this.paddingBottomInPixels;\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the left coordinate of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get left(): string | number {\r\n return this._left.toString(this._host);\r\n }\r\n\r\n public set left(value: string | number) {\r\n if (this._left.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the left coordinate in pixels of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get leftInPixels(): number {\r\n return this._left.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set leftInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.left = value + \"px\";\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the top coordinate of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public get top(): string | number {\r\n return this._top.toString(this._host);\r\n }\r\n\r\n public set top(value: string | number) {\r\n if (this._top.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the top coordinate in pixels of the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public get topInPixels(): number {\r\n return this._top.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n public set topInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.top = value + \"px\";\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the offset on X axis to the linked mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions\r\n */\r\n @serialize()\r\n public get linkOffsetX(): string | number {\r\n return this._linkOffsetX.toString(this._host);\r\n }\r\n\r\n public set linkOffsetX(value: string | number) {\r\n if (this._linkOffsetX.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the offset in pixels on X axis to the linked mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions\r\n */\r\n public get linkOffsetXInPixels(): number {\r\n return this._linkOffsetX.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set linkOffsetXInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.linkOffsetX = value + \"px\";\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the offset on Y axis to the linked mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions\r\n */\r\n @serialize()\r\n public get linkOffsetY(): string | number {\r\n return this._linkOffsetY.toString(this._host);\r\n }\r\n\r\n public set linkOffsetY(value: string | number) {\r\n if (this._linkOffsetY.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets a value indicating the offset in pixels on Y axis to the linked mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions\r\n */\r\n public get linkOffsetYInPixels(): number {\r\n return this._linkOffsetY.getValueInPixel(this._host, this._cachedParentMeasure.height);\r\n }\r\n\r\n public set linkOffsetYInPixels(value: number) {\r\n if (isNaN(value)) {\r\n return;\r\n }\r\n this.linkOffsetY = value + \"px\";\r\n }\r\n\r\n /** Gets the center coordinate on X axis */\r\n public get centerX(): number {\r\n return this._currentMeasure.left + this._currentMeasure.width / 2;\r\n }\r\n\r\n /** Gets the center coordinate on Y axis */\r\n public get centerY(): number {\r\n return this._currentMeasure.top + this._currentMeasure.height / 2;\r\n }\r\n\r\n /** Gets or sets if control is Enabled */\r\n @serialize()\r\n public get isEnabled(): boolean {\r\n return this._isEnabled;\r\n }\r\n\r\n public set isEnabled(value: boolean) {\r\n if (this._isEnabled === value) {\r\n return;\r\n }\r\n\r\n this._isEnabled = value;\r\n this._markAsDirty();\r\n // if this control or any of it's descendants are under a pointer, we need to fire a pointerOut event\r\n const recursivelyFirePointerOut = (control: Control) => {\r\n if (!control.host) {\r\n return;\r\n }\r\n for (const pointer in control.host._lastControlOver) {\r\n if (control === this.host._lastControlOver[pointer]) {\r\n control._onPointerOut(control, null, true);\r\n delete control.host._lastControlOver[pointer];\r\n }\r\n }\r\n if ((control as Container).children !== undefined) {\r\n (control as Container).children.forEach(recursivelyFirePointerOut);\r\n }\r\n };\r\n recursivelyFirePointerOut(this);\r\n this.onEnabledStateChangedObservable.notifyObservers(value);\r\n }\r\n /** Gets or sets background color of control if it's disabled. Only applies to Button class. */\r\n @serialize()\r\n public get disabledColor(): string {\r\n return this._disabledColor;\r\n }\r\n\r\n public set disabledColor(value: string) {\r\n if (this._disabledColor === value) {\r\n return;\r\n }\r\n\r\n this._disabledColor = value;\r\n this._markAsDirty();\r\n }\r\n /** Gets or sets front color of control if it's disabled. Only applies to Checkbox class. */\r\n @serialize()\r\n public get disabledColorItem(): string {\r\n return this._disabledColorItem;\r\n }\r\n\r\n public set disabledColorItem(value: string) {\r\n if (this._disabledColorItem === value) {\r\n return;\r\n }\r\n\r\n this._disabledColorItem = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets/sets the overlap group of the control.\r\n * Controls with overlapGroup set to a number can be deoverlapped.\r\n * Controls with overlapGroup set to undefined are not deoverlapped.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#deoverlapping\r\n */\r\n @serialize()\r\n public overlapGroup?: number;\r\n /**\r\n * Gets/sets the deoverlap movement multiplier\r\n */\r\n @serialize()\r\n public overlapDeltaMultiplier?: number;\r\n\r\n /**\r\n * Array of animations\r\n */\r\n animations: Nullable<Animation[]> = null;\r\n\r\n // Functions\r\n\r\n /**\r\n * Creates a new control\r\n * @param name defines the name of the control\r\n */\r\n constructor(\r\n /** defines the name of the control */\r\n public name?: string\r\n ) {}\r\n\r\n /** @internal */\r\n protected _getTypeName(): string {\r\n return \"Control\";\r\n }\r\n\r\n /**\r\n * Gets the first ascendant in the hierarchy of the given type\r\n * @param className defines the required type\r\n * @returns the ascendant or null if not found\r\n */\r\n public getAscendantOfClass(className: string): Nullable<Control> {\r\n if (!this.parent) {\r\n return null;\r\n }\r\n\r\n if (this.parent.getClassName() === className) {\r\n return this.parent;\r\n }\r\n\r\n return this.parent.getAscendantOfClass(className);\r\n }\r\n\r\n /**\r\n * Mark control element as dirty\r\n * @param force force non visible elements to be marked too\r\n */\r\n public markAsDirty(force = false): void {\r\n this._markAsDirty(force);\r\n }\r\n\r\n /**\r\n * Mark the element and its children as dirty\r\n */\r\n public markAllAsDirty(): void {\r\n this._markAllAsDirty();\r\n }\r\n\r\n /** @internal */\r\n public _resetFontCache(): void {\r\n this._fontSet = true;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Determines if a container is an ascendant of the current control\r\n * @param container defines the container to look for\r\n * @returns true if the container is one of the ascendant of the control\r\n */\r\n public isAscendant(container: Control): boolean {\r\n if (!this.parent) {\r\n return false;\r\n }\r\n\r\n if (this.parent === container) {\r\n return true;\r\n }\r\n\r\n return this.parent.isAscendant(container);\r\n }\r\n\r\n /**\r\n * Gets coordinates in local control space\r\n * @param globalCoordinates defines the coordinates to transform\r\n * @returns the new coordinates in local space\r\n */\r\n public getLocalCoordinates(globalCoordinates: Vector2): Vector2 {\r\n const result = Vector2.Zero();\r\n\r\n this.getLocalCoordinatesToRef(globalCoordinates, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets coordinates in local control space\r\n * @param globalCoordinates defines the coordinates to transform\r\n * @param result defines the target vector2 where to store the result\r\n * @returns the current control\r\n */\r\n public getLocalCoordinatesToRef(globalCoordinates: Vector2, result: Vector2): Control {\r\n result.x = globalCoordinates.x - this._currentMeasure.left;\r\n result.y = globalCoordinates.y - this._currentMeasure.top;\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets coordinates in parent local control space\r\n * @param globalCoordinates defines the coordinates to transform\r\n * @returns the new coordinates in parent local space\r\n */\r\n public getParentLocalCoordinates(globalCoordinates: Vector2): Vector2 {\r\n const result = Vector2.Zero();\r\n\r\n result.x = globalCoordinates.x - this._cachedParentMeasure.left;\r\n result.y = globalCoordinates.y - this._cachedParentMeasure.top;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Move the current control to a vector3 position projected onto the screen.\r\n * @param position defines the target position\r\n * @param scene defines the hosting scene\r\n */\r\n public moveToVector3(position: Vector3, scene: Scene): void {\r\n if (!this._host || this.parent !== this._host._rootContainer) {\r\n Tools.Error(\"Cannot move a control to a vector3 if the control is not at root level\");\r\n return;\r\n }\r\n\r\n this.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n\r\n const globalViewport = this._host._getGlobalViewport();\r\n const projectedPosition = Vector3.Project(position, Matrix.IdentityReadOnly, scene.getTransformMatrix(), globalViewport);\r\n\r\n this._moveToProjectedPosition(projectedPosition);\r\n\r\n if (projectedPosition.z < 0 || projectedPosition.z > 1) {\r\n this.notRenderable = true;\r\n return;\r\n }\r\n this.notRenderable = false;\r\n }\r\n\r\n /**\r\n * Will store all controls that have this control as ascendant in a given array\r\n * @param results defines the array where to store the descendants\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n */\r\n public getDescendantsToRef(results: Control[], directDescendantsOnly: boolean = false, predicate?: (control: Control) => boolean): void {\r\n // Do nothing by default\r\n }\r\n\r\n /**\r\n * Will return all controls that have this control as ascendant\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @returns all child controls\r\n */\r\n public getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[] {\r\n const results: Control[] = [];\r\n\r\n this.getDescendantsToRef(results, directDescendantsOnly, predicate);\r\n\r\n return results;\r\n }\r\n\r\n /**\r\n * Link current control with a target mesh\r\n * @param mesh defines the mesh to link with\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#tracking-positions\r\n */\r\n public linkWithMesh(mesh: Nullable<TransformNode>): void {\r\n if (!this._host || (this.parent && this.parent !== this._host._rootContainer)) {\r\n if (mesh) {\r\n Tools.Error(\"Cannot link a control to a mesh if the control is not at root level\");\r\n }\r\n return;\r\n }\r\n\r\n const index = this._host._linkedControls.indexOf(this);\r\n if (index !== -1) {\r\n this._linkedMesh = mesh;\r\n if (!mesh) {\r\n this._host._linkedControls.splice(index, 1);\r\n }\r\n return;\r\n } else if (!mesh) {\r\n return;\r\n }\r\n\r\n this.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n this._linkedMesh = mesh;\r\n this._host._linkedControls.push(this);\r\n }\r\n\r\n /**\r\n * Shorthand function to set the top, right, bottom, and left padding values on the control.\r\n * @param { string | number} paddingTop - The value of the top padding.\r\n * @param { string | number} paddingRight - The value of the right padding. If omitted, top is used.\r\n * @param { string | number} paddingBottom - The value of the bottom padding. If omitted, top is used.\r\n * @param { string | number} paddingLeft - The value of the left padding. If omitted, right is used.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public setPadding(paddingTop: string | number, paddingRight?: string | number, paddingBottom?: string | number, paddingLeft?: string | number) {\r\n const top = paddingTop;\r\n const right = paddingRight ?? top;\r\n const bottom = paddingBottom ?? top;\r\n const left = paddingLeft ?? right;\r\n\r\n this.paddingTop = top;\r\n this.paddingRight = right;\r\n this.paddingBottom = bottom;\r\n this.paddingLeft = left;\r\n }\r\n\r\n /**\r\n * Shorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.\r\n * @param { number} paddingTop - The value in pixels of the top padding.\r\n * @param { number} paddingRight - The value in pixels of the right padding. If omitted, top is used.\r\n * @param { number} paddingBottom - The value in pixels of the bottom padding. If omitted, top is used.\r\n * @param { number} paddingLeft - The value in pixels of the left padding. If omitted, right is used.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n public setPaddingInPixels(paddingTop: number, paddingRight?: number, paddingBottom?: number, paddingLeft?: number) {\r\n const top = paddingTop;\r\n const right = paddingRight ?? top;\r\n const bottom = paddingBottom ?? top;\r\n const left = paddingLeft ?? right;\r\n\r\n this.paddingTopInPixels = top;\r\n this.paddingRightInPixels = right;\r\n this.paddingBottomInPixels = bottom;\r\n this.paddingLeftInPixels = left;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _moveToProjectedPosition(projectedPosition: Vector3): void {\r\n const oldLeft = this._left.getValue(this._host);\r\n const oldTop = this._top.getValue(this._host);\r\n\r\n const parentMeasure = this.parent?._currentMeasure;\r\n if (parentMeasure) {\r\n this._processMeasures(parentMeasure, this._host.getContext());\r\n }\r\n\r\n let newLeft = projectedPosition.x + this._linkOffsetX.getValue(this._host) - this._currentMeasure.width / 2;\r\n let newTop = projectedPosition.y + this._linkOffsetY.getValue(this._host) - this._currentMeasure.height / 2;\r\n\r\n const leftAndTopIgnoreAdaptiveScaling = this._left.ignoreAdaptiveScaling && this._top.ignoreAdaptiveScaling;\r\n if (leftAndTopIgnoreAdaptiveScaling) {\r\n if (Math.abs(newLeft - oldLeft) < 0.5) {\r\n newLeft = oldLeft;\r\n }\r\n\r\n if (Math.abs(newTop - oldTop) < 0.5) {\r\n newTop = oldTop;\r\n }\r\n }\r\n\r\n if (!leftAndTopIgnoreAdaptiveScaling && oldLeft === newLeft && oldTop === newTop) {\r\n return;\r\n }\r\n\r\n this.left = newLeft + \"px\";\r\n this.top = newTop + \"px\";\r\n\r\n this._left.ignoreAdaptiveScaling = true;\r\n this._top.ignoreAdaptiveScaling = true;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _offsetLeft(offset: number) {\r\n this._isDirty = true;\r\n this._currentMeasure.left += offset;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _offsetTop(offset: number) {\r\n this._isDirty = true;\r\n this._currentMeasure.top += offset;\r\n }\r\n\r\n /** @internal */\r\n public _markMatrixAsDirty(): void {\r\n this._isMatrixDirty = true;\r\n this._flagDescendantsAsMatrixDirty();\r\n }\r\n\r\n /** @internal */\r\n public _flagDescendantsAsMatrixDirty(): void {\r\n // No child\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _intersectsRect(rect: Measure, context?: ICanvasRenderingContext) {\r\n // make sure we are transformed correctly before checking intersections. no-op if nothing is dirty.\r\n this._transform(context);\r\n if (this._evaluatedMeasure.left >= rect.left + rect.width) {\r\n return false;\r\n }\r\n\r\n if (this._evaluatedMeasure.top >= rect.top + rect.height) {\r\n return false;\r\n }\r\n\r\n if (this._evaluatedMeasure.left + this._evaluatedMeasure.width <= rect.left) {\r\n return false;\r\n }\r\n\r\n if (this._evaluatedMeasure.top + this._evaluatedMeasure.height <= rect.top) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n protected _computeAdditionalOffsetX() {\r\n return 0;\r\n }\r\n\r\n /** @internal */\r\n protected _computeAdditionalOffsetY() {\r\n return 0;\r\n }\r\n\r\n /** @internal */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public invalidateRect() {\r\n this._transform();\r\n if (this.host && this.host.useInvalidateRectOptimization) {\r\n // Rotate by transform to get the measure transformed to global space\r\n this._currentMeasure.transformToRef(this._transformMatrix, this._tmpMeasureA);\r\n // get the boudning box of the current measure and last frames measure in global space and invalidate it\r\n // the previous measure is used to properly clear a control that is scaled down\r\n Measure.CombineToRef(this._tmpMeasureA, this._prevCurrentMeasureTransformedIntoGlobalSpace, this._tmpMeasureA);\r\n\r\n // Expand rect based on shadows\r\n const shadowOffsetX = this.shadowOffsetX;\r\n const shadowOffsetY = this.shadowOffsetY;\r\n const shadowBlur = Math.max(this._previousShadowBlur, this.shadowBlur);\r\n\r\n const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0);\r\n const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0);\r\n const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0);\r\n const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0);\r\n\r\n const offsetX = this._computeAdditionalOffsetX();\r\n const offsetY = this._computeAdditionalOffsetY();\r\n\r\n this.host.invalidateRect(\r\n Math.floor(this._tmpMeasureA.left + leftShadowOffset - offsetX),\r\n Math.floor(this._tmpMeasureA.top + topShadowOffset - offsetY),\r\n Math.ceil(this._tmpMeasureA.left + this._tmpMeasureA.width + rightShadowOffset + offsetX),\r\n Math.ceil(this._tmpMeasureA.top + this._tmpMeasureA.height + bottomShadowOffset + offsetY)\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _markAsDirty(force = false): void {\r\n if (!this._isVisible && !force) {\r\n return;\r\n }\r\n\r\n this._isDirty = true;\r\n this._markMatrixAsDirty();\r\n\r\n // Redraw only this rectangle\r\n if (this._host) {\r\n this._host.markAsDirty();\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _markAllAsDirty(): void {\r\n this._markAsDirty();\r\n\r\n if (this._font) {\r\n this._prepareFont();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _link(host: AdvancedDynamicTexture): void {\r\n this._host = host;\r\n if (this._host) {\r\n this.uniqueId = this._host.getScene()!.getUniqueId();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _transform(context?: ICanvasRenderingContext): void {\r\n if (!this._isMatrixDirty && this._scaleX === 1 && this._scaleY === 1 && this._rotation === 0) {\r\n return;\r\n }\r\n\r\n // postTranslate\r\n const offsetX = this._currentMeasure.width * this._transformCenterX + this._currentMeasure.left;\r\n const offsetY = this._currentMeasure.height * this._transformCenterY + this._currentMeasure.top;\r\n if (context) {\r\n context.translate(offsetX, offsetY);\r\n\r\n // rotate\r\n context.rotate(this._rotation);\r\n\r\n // scale\r\n context.scale(this._scaleX, this._scaleY);\r\n\r\n // preTranslate\r\n context.translate(-offsetX, -offsetY);\r\n }\r\n // Need to update matrices?\r\n if (this._isMatrixDirty || this._cachedOffsetX !== offsetX || this._cachedOffsetY !== offsetY) {\r\n this._cachedOffsetX = offsetX;\r\n this._cachedOffsetY = offsetY;\r\n this._isMatrixDirty = false;\r\n this._flagDescendantsAsMatrixDirty();\r\n\r\n Matrix2D.ComposeToRef(-offsetX, -offsetY, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._transformMatrix : null, this._transformMatrix);\r\n\r\n this._transformMatrix.invertToRef(this._invertTransformMatrix);\r\n this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _renderHighlight(context: ICanvasRenderingContext): void {\r\n if (!this.isHighlighted) {\r\n return;\r\n }\r\n\r\n context.save();\r\n context.strokeStyle = this._highlightColor;\r\n context.lineWidth = this._highlightLineWidth;\r\n\r\n this._renderHighlightSpecific(context);\r\n context.restore();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _renderHighlightSpecific(context: ICanvasRenderingContext): void {\r\n context.strokeRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n\r\n protected _getColor(context: ICanvasRenderingContext): string | ICanvasGradient {\r\n return this.gradient ? this.gradient.getCanvasGradient(context) : this.color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _applyStates(context: ICanvasRenderingContext): void {\r\n if (this._isFontSizeInPercentage) {\r\n this._fontSet = true;\r\n }\r\n\r\n if (this._host && this._host.useSmallestIdeal && !this._font) {\r\n this._fontSet = true;\r\n }\r\n\r\n if (this._fontSet) {\r\n this._prepareFont();\r\n this._fontSet = false;\r\n }\r\n\r\n if (this._font) {\r\n context.font = this._font;\r\n }\r\n\r\n if (this._color || this.gradient) {\r\n context.fillStyle = this._getColor(context);\r\n }\r\n\r\n if (Control.AllowAlphaInheritance) {\r\n context.globalAlpha *= this._alpha;\r\n } else if (this._alphaSet) {\r\n context.globalAlpha = this.parent && !this.parent.renderToIntermediateTexture ? this.parent.alpha * this._alpha : this._alpha;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _layout(parentMeasure: Measure, context: ICanvasRenderingContext): boolean {\r\n if (!this.isDirty && (!this.isVisible || this.notRenderable)) {\r\n return false;\r\n }\r\n\r\n if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) {\r\n this.host._numLayoutCalls++;\r\n\r\n this._currentMeasure.addAndTransformToRef(\r\n this._transformMatrix,\r\n -this._paddingLeftInPixels | 0,\r\n -this._paddingTopInPixels | 0,\r\n this._paddingRightInPixels | 0,\r\n this._paddingBottomInPixels | 0,\r\n this._prevCurrentMeasureTransformedIntoGlobalSpace\r\n );\r\n\r\n context.save();\r\n\r\n this._applyStates(context);\r\n\r\n let rebuildCount = 0;\r\n do {\r\n this._rebuildLayout = false;\r\n this._processMeasures(parentMeasure, context);\r\n rebuildCount++;\r\n } while (this._rebuildLayout && rebuildCount < 3);\r\n\r\n if (rebuildCount >= 3) {\r\n Logger.Error(`Layout cycle detected in GUI (Control name=${this.name}, uniqueId=${this.uniqueId})`);\r\n }\r\n\r\n context.restore();\r\n this.invalidateRect();\r\n this._evaluateClippingState(parentMeasure);\r\n }\r\n\r\n this._wasDirty = this._isDirty;\r\n this._isDirty = false;\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _processMeasures(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n this._tempPaddingMeasure.copyFrom(parentMeasure);\r\n\r\n // Apply padding if in correct mode\r\n if (this.parent && this.parent.descendantsOnlyPadding) {\r\n this._tempPaddingMeasure.left += this.parent.paddingLeftInPixels;\r\n this._tempPaddingMeasure.top += this.parent.paddingTopInPixels;\r\n this._tempPaddingMeasure.width -= this.parent.paddingLeftInPixels + this.parent.paddingRightInPixels;\r\n this._tempPaddingMeasure.height -= this.parent.paddingTopInPixels + this.parent.paddingBottomInPixels;\r\n }\r\n\r\n this._currentMeasure.copyFrom(this._tempPaddingMeasure);\r\n\r\n // Let children take some pre-measurement actions\r\n this._preMeasure(this._tempPaddingMeasure, context);\r\n\r\n this._measure();\r\n\r\n // Let children take some post-measurement actions\r\n this._postMeasure(this._tempPaddingMeasure, context);\r\n\r\n this._computeAlignment(this._tempPaddingMeasure, context);\r\n\r\n // Convert to int values\r\n this._currentMeasure.left = this._currentMeasure.left | 0;\r\n this._currentMeasure.top = this._currentMeasure.top | 0;\r\n this._currentMeasure.width = this._currentMeasure.width | 0;\r\n this._currentMeasure.height = this._currentMeasure.height | 0;\r\n\r\n // Let children add more features\r\n this._additionalProcessing(this._tempPaddingMeasure, context);\r\n\r\n this._cachedParentMeasure.copyFrom(this._tempPaddingMeasure);\r\n\r\n this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);\r\n if (this.onDirtyObservable.hasObservers()) {\r\n this.onDirtyObservable.notifyObservers(this);\r\n }\r\n }\r\n\r\n protected _evaluateClippingState(parentMeasure: Measure) {\r\n // Since transformMatrix is used here, we need to have it freshly computed\r\n this._transform();\r\n this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);\r\n if (this.parent && this.parent.clipChildren) {\r\n parentMeasure.transformToRef(this.parent._transformMatrix, this._evaluatedParentMeasure);\r\n // Early clip\r\n if (this._evaluatedMeasure.left > this._evaluatedParentMeasure.left + this._evaluatedParentMeasure.width) {\r\n this._isClipped = true;\r\n return;\r\n }\r\n\r\n if (this._evaluatedMeasure.left + this._evaluatedMeasure.width < this._evaluatedParentMeasure.left) {\r\n this._isClipped = true;\r\n return;\r\n }\r\n\r\n if (this._evaluatedMeasure.top > this._evaluatedParentMeasure.top + this._evaluatedParentMeasure.height) {\r\n this._isClipped = true;\r\n return;\r\n }\r\n\r\n if (this._evaluatedMeasure.top + this._evaluatedMeasure.height < this._evaluatedParentMeasure.top) {\r\n this._isClipped = true;\r\n return;\r\n }\r\n }\r\n\r\n this._isClipped = false;\r\n }\r\n\r\n /** @internal */\r\n public _measure(): void {\r\n // Width / Height\r\n if (this._width.isPixel) {\r\n this._currentMeasure.width = this._width.getValue(this._host);\r\n } else {\r\n this._currentMeasure.width *= this._width.getValue(this._host);\r\n }\r\n\r\n if (this._height.isPixel) {\r\n this._currentMeasure.height = this._height.getValue(this._host);\r\n } else {\r\n this._currentMeasure.height *= this._height.getValue(this._host);\r\n }\r\n\r\n if (this._fixedRatio !== 0) {\r\n if (this._fixedRatioMasterIsWidth) {\r\n this._currentMeasure.height = this._currentMeasure.width * this._fixedRatio;\r\n } else {\r\n this._currentMeasure.width = this._currentMeasure.height * this._fixedRatio;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _computeAlignment(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n const width = this._currentMeasure.width;\r\n const height = this._currentMeasure.height;\r\n\r\n const parentWidth = parentMeasure.width;\r\n const parentHeight = parentMeasure.height;\r\n\r\n // Left / top\r\n let x = 0;\r\n let y = 0;\r\n\r\n switch (this.horizontalAlignment) {\r\n case Control.HORIZONTAL_ALIGNMENT_LEFT:\r\n x = 0;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_RIGHT:\r\n x = parentWidth - width;\r\n break;\r\n case Control.HORIZONTAL_ALIGNMENT_CENTER:\r\n x = (parentWidth - width) / 2;\r\n break;\r\n }\r\n\r\n switch (this.verticalAlignment) {\r\n case Control.VERTICAL_ALIGNMENT_TOP:\r\n y = 0;\r\n break;\r\n case Control.VERTICAL_ALIGNMENT_BOTTOM:\r\n y = parentHeight - height;\r\n break;\r\n case Control.VERTICAL_ALIGNMENT_CENTER:\r\n y = (parentHeight - height) / 2;\r\n break;\r\n }\r\n\r\n if (!this.descendantsOnlyPadding) {\r\n if (this._paddingLeft.isPixel) {\r\n this._currentMeasure.left += this._paddingLeft.getValue(this._host);\r\n this._currentMeasure.width -= this._paddingLeft.getValue(this._host);\r\n } else {\r\n this._currentMeasure.left += parentWidth * this._paddingLeft.getValue(this._host);\r\n this._currentMeasure.width -= parentWidth * this._paddingLeft.getValue(this._host);\r\n }\r\n\r\n if (this._paddingRight.isPixel) {\r\n this._currentMeasure.width -= this._paddingRight.getValue(this._host);\r\n } else {\r\n this._currentMeasure.width -= parentWidth * this._paddingRight.getValue(this._host);\r\n }\r\n\r\n if (this._paddingTop.isPixel) {\r\n this._currentMeasure.top += this._paddingTop.getValue(this._host);\r\n this._currentMeasure.height -= this._paddingTop.getValue(this._host);\r\n } else {\r\n this._currentMeasure.top += parentHeight * this._paddingTop.getValue(this._host);\r\n this._currentMeasure.height -= parentHeight * this._paddingTop.getValue(this._host);\r\n }\r\n\r\n if (this._paddingBottom.isPixel) {\r\n this._currentMeasure.height -= this._paddingBottom.getValue(this._host);\r\n } else {\r\n this._currentMeasure.height -= parentHeight * this._paddingBottom.getValue(this._host);\r\n }\r\n }\r\n\r\n if (this._left.isPixel) {\r\n this._currentMeasure.left += this._left.getValue(this._host);\r\n } else {\r\n this._currentMeasure.left += parentWidth * this._left.getValue(this._host);\r\n }\r\n\r\n if (this._top.isPixel) {\r\n this._currentMeasure.top += this._top.getValue(this._host);\r\n } else {\r\n this._currentMeasure.top += parentHeight * this._top.getValue(this._host);\r\n }\r\n\r\n this._currentMeasure.left += x;\r\n this._currentMeasure.top += y;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _preMeasure(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _postMeasure(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _additionalProcessing(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _clipForChildren(context: ICanvasRenderingContext): void {\r\n // DO nothing\r\n }\r\n\r\n private static _ClipMeasure = new Measure(0, 0, 0, 0);\r\n private _tmpMeasureA = new Measure(0, 0, 0, 0);\r\n private _clip(context: ICanvasRenderingContext, invalidatedRectangle?: Nullable<Measure>) {\r\n context.beginPath();\r\n Control._ClipMeasure.copyFrom(this._currentMeasure);\r\n if (invalidatedRectangle) {\r\n // Rotate the invalidated rect into the control's space\r\n invalidatedRectangle.transformToRef(this._invertTransformMatrix, this._tmpMeasureA);\r\n\r\n // Get the intersection of the rect in context space and the current context\r\n const intersection = new Measure(0, 0, 0, 0);\r\n intersection.left = Math.max(this._tmpMeasureA.left, this._currentMeasure.left);\r\n intersection.top = Math.max(this._tmpMeasureA.top, this._currentMeasure.top);\r\n intersection.width = Math.min(this._tmpMeasureA.left + this._tmpMeasureA.width, this._currentMeasure.left + this._currentMeasure.width) - intersection.left;\r\n intersection.height = Math.min(this._tmpMeasureA.top + this._tmpMeasureA.height, this._currentMeasure.top + this._currentMeasure.height) - intersection.top;\r\n Control._ClipMeasure.copyFrom(intersection);\r\n }\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n const shadowOffsetX = this.shadowOffsetX;\r\n const shadowOffsetY = this.shadowOffsetY;\r\n const shadowBlur = this.shadowBlur;\r\n\r\n const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0);\r\n const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0);\r\n const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0);\r\n const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0);\r\n\r\n context.rect(\r\n Control._ClipMeasure.left + leftShadowOffset,\r\n Control._ClipMeasure.top + topShadowOffset,\r\n Control._ClipMeasure.width + rightShadowOffset - leftShadowOffset,\r\n Control._ClipMeasure.height + bottomShadowOffset - topShadowOffset\r\n );\r\n } else {\r\n context.rect(Control._ClipMeasure.left, Control._ClipMeasure.top, Control._ClipMeasure.width, Control._ClipMeasure.height);\r\n }\r\n\r\n context.clip();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _render(context: ICanvasRenderingContext, invalidatedRectangle?: Nullable<Measure>): boolean {\r\n if (!this.isVisible || this.notRenderable || this._isClipped) {\r\n this._isDirty = false;\r\n return false;\r\n }\r\n\r\n this.host._numRenderCalls++;\r\n\r\n context.save();\r\n\r\n this._applyStates(context);\r\n\r\n // Transform\r\n this._transform(context);\r\n\r\n // Clip\r\n if (this.clipContent) {\r\n this._clip(context, invalidatedRectangle);\r\n }\r\n\r\n if (this.onBeforeDrawObservable.hasObservers()) {\r\n this.onBeforeDrawObservable.notifyObservers(this);\r\n }\r\n\r\n if (this.useBitmapCache && !this._wasDirty && this._cacheData) {\r\n context.putImageData(this._cacheData, this._currentMeasure.left, this._currentMeasure.top);\r\n } else {\r\n this._draw(context, invalidatedRectangle);\r\n }\r\n\r\n if (this.useBitmapCache && this._wasDirty) {\r\n this._cacheData = context.getImageData(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n\r\n this._renderHighlight(context);\r\n\r\n if (this.onAfterDrawObservable.hasObservers()) {\r\n this.onAfterDrawObservable.notifyObservers(this);\r\n }\r\n\r\n context.restore();\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _draw(context: ICanvasRenderingContext, invalidatedRectangle?: Nullable<Measure>): void {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * Tests if a given coordinates belong to the current control\r\n * @param x defines x coordinate to test\r\n * @param y defines y coordinate to test\r\n * @returns true if the coordinates are inside the control\r\n */\r\n public contains(x: number, y: number): boolean {\r\n // Invert transform\r\n this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);\r\n\r\n x = this._transformedPosition.x;\r\n y = this._transformedPosition.y;\r\n\r\n // Check\r\n if (x < this._currentMeasure.left) {\r\n return false;\r\n }\r\n\r\n if (x > this._currentMeasure.left + this._currentMeasure.width) {\r\n return false;\r\n }\r\n\r\n if (y < this._currentMeasure.top) {\r\n return false;\r\n }\r\n\r\n if (y > this._currentMeasure.top + this._currentMeasure.height) {\r\n return false;\r\n }\r\n\r\n if (this.isPointerBlocker) {\r\n this._host._shouldBlockPointer = true;\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _processPicking(x: number, y: number, pi: Nullable<PointerInfoBase>, type: number, pointerId: number, buttonIndex: number, deltaX?: number, deltaY?: number): boolean {\r\n if (!this._isEnabled) {\r\n return false;\r\n }\r\n if (!this.isHitTestVisible || !this.isVisible || this._doNotRender) {\r\n return false;\r\n }\r\n\r\n if (!this.contains(x, y)) {\r\n return false;\r\n }\r\n\r\n this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY);\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: Nullable<PointerInfoBase>): void {\r\n const canNotify: boolean = this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this, pi);\r\n\r\n if (canNotify && this.parent != null && !this.isPointerBlocker) {\r\n this.parent._onPointerMove(target, coordinates, pointerId, pi);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerEnter(target: Control, pi: Nullable<PointerInfoBase>): boolean {\r\n if (!this._isEnabled) {\r\n return false;\r\n }\r\n if (this._enterCount > 0) {\r\n return false;\r\n }\r\n\r\n if (this._enterCount === -1) {\r\n // -1 is for touch input, we are now sure we are with a mouse or pencil\r\n this._enterCount = 0;\r\n }\r\n this._enterCount++;\r\n\r\n const canNotify: boolean = this.onPointerEnterObservable.notifyObservers(this, -1, target, this, pi);\r\n\r\n if (canNotify && this.parent != null && !this.isPointerBlocker) {\r\n this.parent._onPointerEnter(target, pi);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerOut(target: Control, pi: Nullable<PointerInfoBase>, force = false): void {\r\n if (!force && (!this._isEnabled || target === this)) {\r\n return;\r\n }\r\n this._enterCount = 0;\r\n\r\n let canNotify: boolean = true;\r\n\r\n if (!target.isAscendant(this)) {\r\n canNotify = this.onPointerOutObservable.notifyObservers(this, -1, target, this, pi);\r\n }\r\n\r\n if (canNotify && this.parent != null && !this.isPointerBlocker) {\r\n this.parent._onPointerOut(target, pi, force);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: Nullable<PointerInfoBase>): boolean {\r\n // Prevent pointerout to lose control context.\r\n // Event redundancy is checked inside the function.\r\n this._onPointerEnter(this, pi);\r\n\r\n if (this._downCount !== 0) {\r\n return false;\r\n }\r\n\r\n this._downCount++;\r\n\r\n this._downPointerIds[pointerId] = true;\r\n\r\n const canNotify: boolean = this.onPointerDownObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);\r\n\r\n if (canNotify && this.parent != null && !this.isPointerBlocker) {\r\n this.parent._onPointerDown(target, coordinates, pointerId, buttonIndex, pi);\r\n }\r\n\r\n if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) {\r\n this._host._capturedPointerIds.add((pi.event as IPointerEvent).pointerId);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean, pi?: Nullable<PointerInfoBase>): void {\r\n if (!this._isEnabled) {\r\n return;\r\n }\r\n this._downCount = 0;\r\n\r\n delete this._downPointerIds[pointerId];\r\n\r\n let canNotifyClick: boolean = notifyClick;\r\n if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) {\r\n canNotifyClick = this.onPointerClickObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);\r\n }\r\n const canNotify: boolean = this.onPointerUpObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);\r\n\r\n if (canNotify && this.parent != null && !this.isPointerBlocker) {\r\n this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex, canNotifyClick, pi);\r\n }\r\n\r\n if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) {\r\n this._host._capturedPointerIds.delete((pi.event as IPointerEvent).pointerId);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _forcePointerUp(pointerId: Nullable<number> = null) {\r\n if (pointerId !== null) {\r\n this._onPointerUp(this, Vector2.Zero(), pointerId, 0, true);\r\n } else {\r\n for (const key in this._downPointerIds) {\r\n this._onPointerUp(this, Vector2.Zero(), +key as number, 0, true);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onWheelScroll(deltaX?: number, deltaY?: number): void {\r\n if (!this._isEnabled) {\r\n return;\r\n }\r\n const canNotify: boolean = this.onWheelObservable.notifyObservers(new Vector2(deltaX, deltaY));\r\n\r\n if (canNotify && this.parent != null) {\r\n this.parent._onWheelScroll(deltaX, deltaY);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _onCanvasBlur(): void {}\r\n\r\n /**\r\n * @internal\r\n */\r\n public _processObservables(\r\n type: number,\r\n x: number,\r\n y: number,\r\n pi: Nullable<PointerInfoBase>,\r\n pointerId: number,\r\n buttonIndex: number,\r\n deltaX?: number,\r\n deltaY?: number\r\n ): boolean {\r\n if (!this._isEnabled) {\r\n return false;\r\n }\r\n this._dummyVector2.copyFromFloats(x, y);\r\n if (type === PointerEventTypes.POINTERMOVE) {\r\n this._onPointerMove(this, this._dummyVector2, pointerId, pi);\r\n\r\n const previousControlOver = this._host._lastControlOver[pointerId];\r\n if (previousControlOver && previousControlOver !== this) {\r\n previousControlOver._onPointerOut(this, pi);\r\n }\r\n\r\n if (previousControlOver !== this) {\r\n this._onPointerEnter(this, pi);\r\n }\r\n\r\n this._host._lastControlOver[pointerId] = this;\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERDOWN) {\r\n this._onPointerDown(this, this._dummyVector2, pointerId, buttonIndex, pi);\r\n this._host._registerLastControlDown(this, pointerId);\r\n this._host._lastPickedControl = this;\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERUP) {\r\n if (this._host._lastControlDown[pointerId]) {\r\n this._host._lastControlDown[pointerId]._onPointerUp(this, this._dummyVector2, pointerId, buttonIndex, true, pi);\r\n }\r\n delete this._host._lastControlDown[pointerId];\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERWHEEL) {\r\n if (this._host._lastControlOver[pointerId]) {\r\n this._host._lastControlOver[pointerId]._onWheelScroll(deltaX, deltaY);\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private _getStyleProperty(propName: \"fontStyle\" | \"fontWeight\" | \"fontFamily\", defaultValue: string): string {\r\n const prop = (this._style && this._style[propName]) ?? this[propName];\r\n if (!prop && this.parent) {\r\n return this.parent._getStyleProperty(propName, defaultValue);\r\n } else if (!this.parent) {\r\n return defaultValue;\r\n } else {\r\n return prop;\r\n }\r\n }\r\n\r\n private _prepareFont() {\r\n if (!this._font && !this._fontSet) {\r\n return;\r\n }\r\n\r\n this._font =\r\n this._getStyleProperty(\"fontStyle\", \"\") +\r\n \" \" +\r\n this._getStyleProperty(\"fontWeight\", \"\") +\r\n \" \" +\r\n this.fontSizeInPixels +\r\n \"px \" +\r\n this._getStyleProperty(\"fontFamily\", \"Arial\");\r\n\r\n this._fontOffset = Control._GetFontOffset(this._font, this._host?.getScene()?.getEngine());\r\n\r\n //children need to be refreshed\r\n this.getDescendants().forEach((child) => child._markAllAsDirty());\r\n }\r\n\r\n /**\r\n * A control has a dimension fully defined if that dimension doesn't depend on the parent's dimension.\r\n * As an example, a control that has dimensions in pixels is fully defined, while in percentage is not fully defined.\r\n * @param dim the dimension to check (width or height)\r\n * @returns if the dimension is fully defined\r\n */\r\n public isDimensionFullyDefined(dim: \"width\" | \"height\"): boolean {\r\n return this.getDimension(dim).isPixel;\r\n }\r\n\r\n /**\r\n * Gets the dimension of the control along a specified axis\r\n * @param dim the dimension to retrieve (width or height)\r\n * @returns the dimension value along the specified axis\r\n */\r\n public getDimension(dim: \"width\" | \"height\"): ValueAndUnit {\r\n if (dim === \"width\") {\r\n return this._width;\r\n } else {\r\n return this._height;\r\n }\r\n }\r\n\r\n /**\r\n * Clones a control and its descendants\r\n * @param host the texture where the control will be instantiated. Can be empty, in which case the control will be created on the same texture\r\n * @returns the cloned control\r\n */\r\n public clone(host?: AdvancedDynamicTexture): Control {\r\n const serialization: any = {};\r\n this.serialize(serialization, true);\r\n\r\n const controlType = Tools.Instantiate(\"BABYLON.GUI.\" + serialization.className);\r\n const cloned = new controlType();\r\n cloned.parse(serialization, host);\r\n\r\n return cloned;\r\n }\r\n\r\n /**\r\n * Parses a serialized object into this control\r\n * @param serializedObject the object with the serialized properties\r\n * @param host the texture where the control will be instantiated. Can be empty, in which case the control will be created on the same texture\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @returns this control\r\n */\r\n public parse(serializedObject: any, host?: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): Control {\r\n this._urlRewriter = urlRewriter;\r\n SerializationHelper.Parse(() => this, serializedObject, null);\r\n\r\n this.name = serializedObject.name;\r\n\r\n this._parseFromContent(serializedObject, host ?? this._host);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Serializes the current control\r\n * @param serializationObject defined the JSON serialized object\r\n * @param force if the control should be serialized even if the isSerializable flag is set to false (default false)\r\n * @param allowCanvas defines if the control is allowed to use a Canvas2D object to serialize (true by default)\r\n */\r\n public serialize(serializationObject: any, force: boolean = false, allowCanvas: boolean = true) {\r\n if (!this.isSerializable && !force) {\r\n return;\r\n }\r\n SerializationHelper.Serialize(this, serializationObject);\r\n serializationObject.name = this.name;\r\n serializationObject.className = this.getClassName();\r\n\r\n // Call prepareFont to guarantee the font is properly set before serializing\r\n if (allowCanvas) {\r\n this._prepareFont();\r\n }\r\n if (this._fontFamily) {\r\n serializationObject.fontFamily = this._fontFamily;\r\n }\r\n if (this.fontSize) {\r\n serializationObject.fontSize = this.fontSize;\r\n }\r\n if (this.fontWeight) {\r\n serializationObject.fontWeight = this.fontWeight;\r\n }\r\n if (this.fontStyle) {\r\n serializationObject.fontStyle = this.fontStyle;\r\n }\r\n\r\n if (this._gradient) {\r\n serializationObject.gradient = {};\r\n this._gradient.serialize(serializationObject.gradient);\r\n }\r\n\r\n // Animations\r\n SerializationHelper.AppendSerializedAnimations(this, serializationObject);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _parseFromContent(serializedObject: any, host: AdvancedDynamicTexture, urlRewriter?: (url: string) => string) {\r\n if (serializedObject.fontFamily) {\r\n this.fontFamily = serializedObject.fontFamily;\r\n }\r\n\r\n if (serializedObject.fontSize) {\r\n this.fontSize = serializedObject.fontSize;\r\n }\r\n\r\n if (serializedObject.fontWeight) {\r\n this.fontWeight = serializedObject.fontWeight;\r\n }\r\n\r\n if (serializedObject.fontStyle) {\r\n this.fontStyle = serializedObject.fontStyle;\r\n }\r\n\r\n // Gradient\r\n if (serializedObject.gradient) {\r\n const className = Tools.Instantiate(\"BABYLON.GUI.\" + serializedObject.gradient.className);\r\n this._gradient = new className();\r\n this._gradient?.parse(serializedObject.gradient);\r\n }\r\n\r\n // Animations\r\n if (serializedObject.animations) {\r\n this.animations = [];\r\n for (let animationIndex = 0; animationIndex < serializedObject.animations.length; animationIndex++) {\r\n const parsedAnimation = serializedObject.animations[animationIndex];\r\n const internalClass = GetClass(\"BABYLON.Animation\");\r\n if (internalClass) {\r\n this.animations.push(internalClass.Parse(parsedAnimation));\r\n }\r\n }\r\n\r\n if (serializedObject.autoAnimate && this._host && this._host.getScene()) {\r\n this._host\r\n .getScene()!\r\n .beginAnimation(\r\n this,\r\n serializedObject.autoAnimateFrom,\r\n serializedObject.autoAnimateTo,\r\n serializedObject.autoAnimateLoop,\r\n serializedObject.autoAnimateSpeed || 1.0\r\n );\r\n }\r\n }\r\n\r\n this.fixedRatioMasterIsWidth = serializedObject.fixedRatioMasterIsWidth ?? this.fixedRatioMasterIsWidth;\r\n }\r\n\r\n /** Releases associated resources */\r\n public dispose() {\r\n this.onDirtyObservable.clear();\r\n this.onBeforeDrawObservable.clear();\r\n this.onAfterDrawObservable.clear();\r\n this.onPointerDownObservable.clear();\r\n this.onPointerEnterObservable.clear();\r\n this.onPointerMoveObservable.clear();\r\n this.onPointerOutObservable.clear();\r\n this.onPointerUpObservable.clear();\r\n this.onPointerClickObservable.clear();\r\n this.onWheelObservable.clear();\r\n\r\n if (this._styleObserver && this._style) {\r\n this._style.onChangedObservable.remove(this._styleObserver);\r\n this._styleObserver = null;\r\n }\r\n\r\n if (this.parent) {\r\n this.parent.removeControl(this);\r\n this.parent = null;\r\n }\r\n\r\n if (this._host) {\r\n const index = this._host._linkedControls.indexOf(this);\r\n if (index > -1) {\r\n this.linkWithMesh(null);\r\n }\r\n }\r\n\r\n // Callback\r\n this.onDisposeObservable.notifyObservers(this);\r\n this.onDisposeObservable.clear();\r\n }\r\n\r\n // Statics\r\n private static _HORIZONTAL_ALIGNMENT_LEFT = 0;\r\n private static _HORIZONTAL_ALIGNMENT_RIGHT = 1;\r\n private static _HORIZONTAL_ALIGNMENT_CENTER = 2;\r\n\r\n private static _VERTICAL_ALIGNMENT_TOP = 0;\r\n private static _VERTICAL_ALIGNMENT_BOTTOM = 1;\r\n private static _VERTICAL_ALIGNMENT_CENTER = 2;\r\n\r\n /** HORIZONTAL_ALIGNMENT_LEFT */\r\n public static get HORIZONTAL_ALIGNMENT_LEFT(): number {\r\n return Control._HORIZONTAL_ALIGNMENT_LEFT;\r\n }\r\n\r\n /** HORIZONTAL_ALIGNMENT_RIGHT */\r\n public static get HORIZONTAL_ALIGNMENT_RIGHT(): number {\r\n return Control._HORIZONTAL_ALIGNMENT_RIGHT;\r\n }\r\n\r\n /** HORIZONTAL_ALIGNMENT_CENTER */\r\n public static get HORIZONTAL_ALIGNMENT_CENTER(): number {\r\n return Control._HORIZONTAL_ALIGNMENT_CENTER;\r\n }\r\n\r\n /** VERTICAL_ALIGNMENT_TOP */\r\n public static get VERTICAL_ALIGNMENT_TOP(): number {\r\n return Control._VERTICAL_ALIGNMENT_TOP;\r\n }\r\n\r\n /** VERTICAL_ALIGNMENT_BOTTOM */\r\n public static get VERTICAL_ALIGNMENT_BOTTOM(): number {\r\n return Control._VERTICAL_ALIGNMENT_BOTTOM;\r\n }\r\n\r\n /** VERTICAL_ALIGNMENT_CENTER */\r\n public static get VERTICAL_ALIGNMENT_CENTER(): number {\r\n return Control._VERTICAL_ALIGNMENT_CENTER;\r\n }\r\n\r\n private static _FontHeightSizes: { [key: string]: { ascent: number; height: number; descent: number } } = {};\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _GetFontOffset(font: string, engineToUse?: AbstractEngine): { ascent: number; height: number; descent: number } {\r\n if (Control._FontHeightSizes[font]) {\r\n return Control._FontHeightSizes[font];\r\n }\r\n\r\n const engine = engineToUse || EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n throw new Error(\"Invalid engine. Unable to create a canvas.\");\r\n }\r\n\r\n const result = engine.getFontOffset(font);\r\n Control._FontHeightSizes[font] = result;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a Control from parsed data\r\n * @param serializedObject defines parsed data\r\n * @param host defines the hosting AdvancedDynamicTexture\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @returns a new Control\r\n */\r\n public static Parse(serializedObject: any, host: AdvancedDynamicTexture, urlRewriter?: (url: string) => string): Control {\r\n const controlType = Tools.Instantiate(\"BABYLON.GUI.\" + serializedObject.className);\r\n const control = SerializationHelper.Parse(\r\n () => {\r\n const newControl = new controlType() as Control;\r\n newControl._urlRewriter = urlRewriter;\r\n return newControl;\r\n },\r\n serializedObject,\r\n null\r\n );\r\n\r\n control.name = serializedObject.name;\r\n\r\n control._parseFromContent(serializedObject, host, urlRewriter);\r\n\r\n return control;\r\n }\r\n\r\n public static AddHeader: (control: Control, text: string, size: string | number, options: { isHorizontal: boolean; controlFirst: boolean }) => any = () => {};\r\n\r\n /**\r\n * @internal\r\n */\r\n protected static drawEllipse(x: number, y: number, width: number, height: number, context: ICanvasRenderingContext): void {\r\n context.translate(x, y);\r\n context.scale(width, height);\r\n\r\n context.beginPath();\r\n context.arc(0, 0, 1, 0, 2 * Math.PI);\r\n context.closePath();\r\n\r\n context.scale(1 / width, 1 / height);\r\n context.translate(-x, -y);\r\n }\r\n\r\n /**\r\n * Returns true if the control is ready to be used\r\n * @returns\r\n */\r\n public isReady(): boolean {\r\n // Most controls are ready by default, so the default implementation is to return true\r\n return true;\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.Control\", Control);\r\n"]}
@@ -741,36 +741,45 @@ export class Image extends Control {
741
741
  context.restore();
742
742
  }
743
743
  _renderNinePatch(context, sx, sy, sw, sh) {
744
+ const idealRatio = this.host.idealWidth
745
+ ? this._width.getValue(this.host) / this.host.idealWidth
746
+ : this.host.idealHeight
747
+ ? this._height.getValue(this.host) / this.host.idealHeight
748
+ : 1;
744
749
  const leftWidth = this._sliceLeft;
745
750
  const topHeight = this._sliceTop;
746
751
  const bottomHeight = sh - this._sliceBottom;
747
752
  const rightWidth = sw - this._sliceRight;
748
753
  const centerWidth = this._sliceRight - this._sliceLeft;
749
754
  const centerHeight = this._sliceBottom - this._sliceTop;
750
- const targetCenterWidth = this._currentMeasure.width - rightWidth - leftWidth + 2;
751
- const targetCenterHeight = this._currentMeasure.height - bottomHeight - topHeight + 2;
752
- const centerLeftOffset = this._currentMeasure.left + leftWidth - 1;
753
- const centerTopOffset = this._currentMeasure.top + topHeight - 1;
754
- const rightOffset = this._currentMeasure.left + this._currentMeasure.width - rightWidth;
755
- const bottomOffset = this._currentMeasure.top + this._currentMeasure.height - bottomHeight;
755
+ const leftWidthAdjusted = Math.round(leftWidth * idealRatio);
756
+ const topHeightAdjusted = Math.round(topHeight * idealRatio);
757
+ const bottomHeightAdjusted = Math.round(bottomHeight * idealRatio);
758
+ const rightWidthAdjusted = Math.round(rightWidth * idealRatio);
759
+ const targetCenterWidth = Math.round(this._currentMeasure.width) - rightWidthAdjusted - leftWidthAdjusted + 2;
760
+ const targetCenterHeight = Math.round(this._currentMeasure.height) - bottomHeightAdjusted - topHeightAdjusted + 2;
761
+ const centerLeftOffset = Math.round(this._currentMeasure.left) + leftWidthAdjusted - 1;
762
+ const centerTopOffset = Math.round(this._currentMeasure.top) + topHeightAdjusted - 1;
763
+ const rightOffset = Math.round(this._currentMeasure.left + this._currentMeasure.width) - rightWidthAdjusted;
764
+ const bottomOffset = Math.round(this._currentMeasure.top + this._currentMeasure.height) - bottomHeightAdjusted;
756
765
  //Top Left
757
- this._drawImage(context, sx, sy, leftWidth, topHeight, this._currentMeasure.left, this._currentMeasure.top, leftWidth, topHeight);
766
+ this._drawImage(context, sx, sy, leftWidth, topHeight, this._currentMeasure.left, this._currentMeasure.top, leftWidthAdjusted, topHeightAdjusted);
758
767
  //Top
759
- this._drawImage(context, sx + this._sliceLeft, sy, centerWidth, topHeight, centerLeftOffset + 1, this._currentMeasure.top, targetCenterWidth - 2, topHeight);
768
+ this._drawImage(context, sx + this._sliceLeft, sy, centerWidth, topHeight, centerLeftOffset + 1, this._currentMeasure.top, targetCenterWidth - 2, topHeightAdjusted);
760
769
  //Top Right
761
- this._drawImage(context, sx + this._sliceRight, sy, rightWidth, topHeight, rightOffset, this._currentMeasure.top, rightWidth, topHeight);
770
+ this._drawImage(context, sx + this._sliceRight, sy, rightWidth, topHeight, rightOffset, this._currentMeasure.top, rightWidthAdjusted, topHeightAdjusted);
762
771
  //Left
763
- this._drawImage(context, sx, sy + this._sliceTop, leftWidth, centerHeight, this._currentMeasure.left, centerTopOffset + 1, leftWidth, targetCenterHeight - 2);
772
+ this._drawImage(context, sx, sy + this._sliceTop, leftWidth, centerHeight, this._currentMeasure.left, centerTopOffset + 1, leftWidthAdjusted, targetCenterHeight - 2);
764
773
  // Center
765
- this._drawImage(context, sx + this._sliceLeft, sy + this._sliceTop, centerWidth, centerHeight, centerLeftOffset, centerTopOffset, targetCenterWidth, targetCenterHeight);
774
+ this._drawImage(context, sx + this._sliceLeft, sy + this._sliceTop, centerWidth, centerHeight, centerLeftOffset + 1, centerTopOffset + 1, targetCenterWidth - 2, targetCenterHeight - 2);
766
775
  //Right
767
- this._drawImage(context, sx + this._sliceRight, sy + this._sliceTop, rightWidth, centerHeight, rightOffset, centerTopOffset + 1, rightWidth, targetCenterHeight - 2);
776
+ this._drawImage(context, sx + this._sliceRight, sy + this._sliceTop, rightWidth, centerHeight, rightOffset, centerTopOffset + 1, rightWidthAdjusted, targetCenterHeight - 2);
768
777
  //Bottom Left
769
- this._drawImage(context, sx, sy + this._sliceBottom, leftWidth, bottomHeight, this._currentMeasure.left, bottomOffset, leftWidth, bottomHeight);
778
+ this._drawImage(context, sx, sy + this._sliceBottom, leftWidth, bottomHeight, this._currentMeasure.left, bottomOffset, leftWidthAdjusted, bottomHeightAdjusted);
770
779
  //Bottom
771
- this._drawImage(context, sx + this.sliceLeft, sy + this._sliceBottom, centerWidth, bottomHeight, centerLeftOffset + 1, bottomOffset, targetCenterWidth - 2, bottomHeight);
780
+ this._drawImage(context, sx + this.sliceLeft, sy + this._sliceBottom, centerWidth, bottomHeight, centerLeftOffset + 1, bottomOffset, targetCenterWidth - 2, bottomHeightAdjusted);
772
781
  //Bottom Right
773
- this._drawImage(context, sx + this._sliceRight, sy + this._sliceBottom, rightWidth, bottomHeight, rightOffset, bottomOffset, rightWidth, bottomHeight);
782
+ this._drawImage(context, sx + this._sliceRight, sy + this._sliceBottom, rightWidth, bottomHeight, rightOffset, bottomOffset, rightWidthAdjusted, bottomHeightAdjusted);
774
783
  }
775
784
  dispose() {
776
785
  super.dispose();
@@ -1 +1 @@
1
- {"version":3,"file":"image.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/image.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,KAAK,EAAE,sCAAwB;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAEjD,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,OAAO;IA8D9B;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEe,OA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AY,GAAG,CAAC,AAAJ,CAAK;AACxC,sBAAsB;AACC,qBAAe,GAAG,CAAC,AAAJ,CAAK;AAC3C,qBAAqB;AACE,oBAAc,GAAG,CAAC,AAAJ,CAAK;AAC1C,iBAAiB;AACM,wBAAkB,GAAG,CAAC,AAAJ,CAAK;AAp4B9C;IADC,SAAS,EAAE;sDAGX;AAcD;IADC,SAAS,EAAE;sCAGX;AAgBD;IADC,SAAS,EAAE;uCAGX;AAgBD;IADC,SAAS,EAAE;qCAGX;AAgBD;IADC,SAAS,EAAE;wCAGX;AAgBD;IADC,SAAS,EAAE;uCAGX;AAgBD;IADC,SAAS,EAAE;sCAGX;AAgBD;IADC,SAAS,EAAE;wCAGX;AAgBD;IADC,SAAS,EAAE;yCAGX;AA8BD;IADC,SAAS,EAAE;6DAGX;AA6BD;IADC,SAAS,EAAE;sCAGX;AAgBD;IADC,SAAS,EAAE;oCAGX;AAsMD;IADC,SAAS,EAAE;mCAGX;AAuLD;IADC,SAAS,EAAE;sCAGX;AAeD;IADC,SAAS,EAAE;uCAGX;AAeD;IADC,SAAS,EAAE;mCAGX;AAkQL,aAAa,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Tools } from \"core/Misc/tools\";\r\n\r\nimport { Control } from \"./control\";\r\nimport type { Measure } from \"../measure\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvas, ICanvasRenderingContext, IImage } from \"core/Engines/ICanvas\";\r\nimport { EngineStore } from \"core/Engines/engineStore\";\r\n\r\n/**\r\n * Class used to create 2D images\r\n */\r\nexport class Image extends Control {\r\n /**\r\n * Specifies an alternate text for the image, if the image for some reason cannot be displayed.\r\n */\r\n public alt?: string;\r\n\r\n private _workingCanvas: Nullable<ICanvas> = null;\r\n\r\n private _domImage: IImage;\r\n private _imageWidth: number;\r\n private _imageHeight: number;\r\n private _loaded = false;\r\n private _stretch = Image.STRETCH_FILL;\r\n private _source: Nullable<string>;\r\n private _autoScale = false;\r\n\r\n private _sourceLeft = 0;\r\n private _sourceTop = 0;\r\n private _sourceWidth = 0;\r\n private _sourceHeight = 0;\r\n private _svgAttributesComputationCompleted: boolean = false;\r\n private _isSVG: boolean = false;\r\n\r\n private _cellWidth: number = 0;\r\n private _cellHeight: number = 0;\r\n private _cellId: number = -1;\r\n\r\n private _sliceLeft: number;\r\n private _sliceRight: number;\r\n private _sliceTop: number;\r\n private _sliceBottom: number;\r\n\r\n private _populateNinePatchSlicesFromImage = false;\r\n\r\n private _detectPointerOnOpaqueOnly: boolean;\r\n\r\n private _imageDataCache: {\r\n data: Uint8ClampedArray | null;\r\n key: string;\r\n } = { data: null, key: \"\" };\r\n\r\n /**\r\n * Cache of images to avoid loading the same image multiple times\r\n */\r\n public static SourceImgCache = new Map<string, { img: IImage; timesUsed: number; loaded: boolean; waitingForLoadCallback: Array<() => void> }>();\r\n\r\n /**\r\n * Observable notified when the content is loaded\r\n */\r\n public onImageLoadedObservable = new Observable<Image>();\r\n\r\n /**\r\n * Observable notified when _sourceLeft, _sourceTop, _sourceWidth and _sourceHeight are computed\r\n */\r\n public onSVGAttributesComputedObservable = new Observable<Image>();\r\n\r\n /**\r\n * Gets or sets the referrer policy to apply on the img element load request.\r\n * You should set referrerPolicy before set the source of the image if you want to ensure the header will be present on the xhr loading request\r\n */\r\n public referrerPolicy: Nullable<ReferrerPolicy>;\r\n\r\n /**\r\n * Gets a boolean indicating that the content is loaded\r\n */\r\n public get isLoaded(): boolean {\r\n return this._loaded;\r\n }\r\n\r\n public override isReady(): boolean {\r\n return this.isLoaded;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if pointers should only be validated on pixels with alpha > 0.\r\n * Beware using this as this will consume more memory as the image has to be stored twice\r\n */\r\n @serialize()\r\n public get detectPointerOnOpaqueOnly(): boolean {\r\n return this._detectPointerOnOpaqueOnly;\r\n }\r\n\r\n public set detectPointerOnOpaqueOnly(value: boolean) {\r\n if (this._detectPointerOnOpaqueOnly === value) {\r\n return;\r\n }\r\n\r\n this._detectPointerOnOpaqueOnly = value;\r\n }\r\n\r\n /**\r\n * Gets or sets the left value for slicing (9-patch)\r\n */\r\n @serialize()\r\n public get sliceLeft(): number {\r\n return this._sliceLeft;\r\n }\r\n\r\n public set sliceLeft(value: number) {\r\n if (this._sliceLeft === value) {\r\n return;\r\n }\r\n\r\n this._sliceLeft = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the right value for slicing (9-patch)\r\n */\r\n @serialize()\r\n public get sliceRight(): number {\r\n return this._sliceRight;\r\n }\r\n\r\n public set sliceRight(value: number) {\r\n if (this._sliceRight === value) {\r\n return;\r\n }\r\n\r\n this._sliceRight = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the top value for slicing (9-patch)\r\n */\r\n @serialize()\r\n public get sliceTop(): number {\r\n return this._sliceTop;\r\n }\r\n\r\n public set sliceTop(value: number) {\r\n if (this._sliceTop === value) {\r\n return;\r\n }\r\n\r\n this._sliceTop = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the bottom value for slicing (9-patch)\r\n */\r\n @serialize()\r\n public get sliceBottom(): number {\r\n return this._sliceBottom;\r\n }\r\n\r\n public set sliceBottom(value: number) {\r\n if (this._sliceBottom === value) {\r\n return;\r\n }\r\n\r\n this._sliceBottom = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the left coordinate in the source image\r\n */\r\n @serialize()\r\n public get sourceLeft(): number {\r\n return this._sourceLeft;\r\n }\r\n\r\n public set sourceLeft(value: number) {\r\n if (this._sourceLeft === value) {\r\n return;\r\n }\r\n\r\n this._sourceLeft = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the top coordinate in the source image\r\n */\r\n @serialize()\r\n public get sourceTop(): number {\r\n return this._sourceTop;\r\n }\r\n\r\n public set sourceTop(value: number) {\r\n if (this._sourceTop === value) {\r\n return;\r\n }\r\n\r\n this._sourceTop = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the width to capture in the source image\r\n */\r\n @serialize()\r\n public get sourceWidth(): number {\r\n return this._sourceWidth;\r\n }\r\n\r\n public set sourceWidth(value: number) {\r\n if (this._sourceWidth === value) {\r\n return;\r\n }\r\n\r\n this._sourceWidth = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the height to capture in the source image\r\n */\r\n @serialize()\r\n public get sourceHeight(): number {\r\n return this._sourceHeight;\r\n }\r\n\r\n public set sourceHeight(value: number) {\r\n if (this._sourceHeight === value) {\r\n return;\r\n }\r\n\r\n this._sourceHeight = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the image width\r\n */\r\n public get imageWidth(): number {\r\n return this._imageWidth;\r\n }\r\n\r\n /**\r\n * Gets the image height\r\n */\r\n public get imageHeight(): number {\r\n return this._imageHeight;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if nine patch slices (left, top, right, bottom) should be read from image data\r\n */\r\n @serialize()\r\n public get populateNinePatchSlicesFromImage(): boolean {\r\n return this._populateNinePatchSlicesFromImage;\r\n }\r\n\r\n public set populateNinePatchSlicesFromImage(value: boolean) {\r\n if (this._populateNinePatchSlicesFromImage === value) {\r\n return;\r\n }\r\n\r\n this._populateNinePatchSlicesFromImage = value;\r\n\r\n if (this._populateNinePatchSlicesFromImage && this._loaded) {\r\n this._extractNinePatchSliceDataFromImage();\r\n }\r\n }\r\n\r\n /** Indicates if the format of the image is SVG */\r\n public get isSVG(): boolean {\r\n return this._isSVG;\r\n }\r\n\r\n /** Gets the status of the SVG attributes computation (sourceLeft, sourceTop, sourceWidth, sourceHeight) */\r\n public get svgAttributesComputationCompleted(): boolean {\r\n return this._svgAttributesComputationCompleted;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the image can force its container to adapt its size\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#image\r\n */\r\n @serialize()\r\n public get autoScale(): boolean {\r\n return this._autoScale;\r\n }\r\n\r\n public set autoScale(value: boolean) {\r\n if (this._autoScale === value) {\r\n return;\r\n }\r\n\r\n this._autoScale = value;\r\n\r\n if (value && this._loaded) {\r\n this.synchronizeSizeWithContent();\r\n }\r\n }\r\n\r\n /** Gets or sets the stretching mode used by the image */\r\n @serialize()\r\n public get stretch(): number {\r\n return this._stretch;\r\n }\r\n\r\n public set stretch(value: number) {\r\n if (this._stretch === value) {\r\n return;\r\n }\r\n\r\n this._stretch = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _rotate90(n: number, preserveProperties: boolean = false): Image {\r\n const width = this._domImage.width;\r\n const height = this._domImage.height;\r\n\r\n // Should abstract platform instead of using LastCreatedEngine\r\n const engine = this._host?.getScene()?.getEngine() || EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n throw new Error(\"Invalid engine. Unable to create a canvas.\");\r\n }\r\n const canvas = engine.createCanvas(height, width);\r\n\r\n const context = canvas.getContext(\"2d\")!;\r\n\r\n context.translate(canvas.width / 2, canvas.height / 2);\r\n context.rotate((n * Math.PI) / 2);\r\n\r\n context.drawImage(this._domImage, 0, 0, width, height, -width / 2, -height / 2, width, height);\r\n\r\n const dataUrl: string = canvas.toDataURL(\"image/jpg\");\r\n const rotatedImage = new Image(this.name + \"rotated\", dataUrl);\r\n\r\n if (preserveProperties) {\r\n rotatedImage._stretch = this._stretch;\r\n rotatedImage._autoScale = this._autoScale;\r\n rotatedImage._cellId = this._cellId;\r\n rotatedImage._cellWidth = n % 1 ? this._cellHeight : this._cellWidth;\r\n rotatedImage._cellHeight = n % 1 ? this._cellWidth : this._cellHeight;\r\n }\r\n\r\n this._handleRotationForSVGImage(this, rotatedImage, n);\r\n\r\n this._imageDataCache.data = null;\r\n\r\n return rotatedImage;\r\n }\r\n\r\n private _handleRotationForSVGImage(srcImage: Image, dstImage: Image, n: number): void {\r\n if (!srcImage._isSVG) {\r\n return;\r\n }\r\n\r\n if (srcImage._svgAttributesComputationCompleted) {\r\n this._rotate90SourceProperties(srcImage, dstImage, n);\r\n this._markAsDirty();\r\n } else {\r\n srcImage.onSVGAttributesComputedObservable.addOnce(() => {\r\n this._rotate90SourceProperties(srcImage, dstImage, n);\r\n this._markAsDirty();\r\n });\r\n }\r\n }\r\n\r\n private _rotate90SourceProperties(srcImage: Image, dstImage: Image, n: number): void {\r\n let srcLeft = srcImage.sourceLeft,\r\n srcTop = srcImage.sourceTop,\r\n srcWidth = srcImage.domImage.width,\r\n srcHeight = srcImage.domImage.height;\r\n\r\n let dstLeft = srcLeft,\r\n dstTop = srcTop,\r\n dstWidth = srcImage.sourceWidth,\r\n dstHeight = srcImage.sourceHeight;\r\n\r\n if (n != 0) {\r\n const mult = n < 0 ? -1 : 1;\r\n n = n % 4;\r\n for (let i = 0; i < Math.abs(n); ++i) {\r\n dstLeft = -(srcTop - srcHeight / 2) * mult + srcHeight / 2;\r\n dstTop = (srcLeft - srcWidth / 2) * mult + srcWidth / 2;\r\n [dstWidth, dstHeight] = [dstHeight, dstWidth];\r\n if (n < 0) {\r\n dstTop -= dstHeight;\r\n } else {\r\n dstLeft -= dstWidth;\r\n }\r\n srcLeft = dstLeft;\r\n srcTop = dstTop;\r\n [srcWidth, srcHeight] = [srcHeight, srcWidth];\r\n }\r\n }\r\n\r\n dstImage.sourceLeft = dstLeft;\r\n dstImage.sourceTop = dstTop;\r\n dstImage.sourceWidth = dstWidth;\r\n dstImage.sourceHeight = dstHeight;\r\n }\r\n\r\n private _extractNinePatchSliceDataFromImage() {\r\n const width = this._domImage.width;\r\n const height = this._domImage.height;\r\n\r\n if (!this._workingCanvas) {\r\n const engine = this._host?.getScene()?.getEngine() || EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n throw new Error(\"Invalid engine. Unable to create a canvas.\");\r\n }\r\n this._workingCanvas = engine.createCanvas(width, height);\r\n }\r\n const canvas = this._workingCanvas;\r\n const context = canvas.getContext(\"2d\")!;\r\n\r\n context.drawImage(this._domImage, 0, 0, width, height);\r\n const imageData = context.getImageData(0, 0, width, height);\r\n\r\n // Left and right\r\n this._sliceLeft = -1;\r\n this._sliceRight = -1;\r\n for (let x = 0; x < width; x++) {\r\n const alpha = imageData.data[x * 4 + 3];\r\n\r\n if (alpha > 127 && this._sliceLeft === -1) {\r\n this._sliceLeft = x;\r\n continue;\r\n }\r\n\r\n if (alpha < 127 && this._sliceLeft > -1) {\r\n this._sliceRight = x;\r\n break;\r\n }\r\n }\r\n\r\n // top and bottom\r\n this._sliceTop = -1;\r\n this._sliceBottom = -1;\r\n for (let y = 0; y < height; y++) {\r\n const alpha = imageData.data[y * width * 4 + 3];\r\n\r\n if (alpha > 127 && this._sliceTop === -1) {\r\n this._sliceTop = y;\r\n continue;\r\n }\r\n\r\n if (alpha < 127 && this._sliceTop > -1) {\r\n this._sliceBottom = y;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the internal DOM image used to render the control\r\n */\r\n public set domImage(value: IImage) {\r\n this._domImage = value;\r\n this._loaded = false;\r\n this._imageDataCache.data = null;\r\n\r\n if (this._domImage.width) {\r\n this._onImageLoaded();\r\n } else {\r\n this._domImage.onload = () => {\r\n this._onImageLoaded();\r\n };\r\n }\r\n }\r\n\r\n public get domImage(): IImage {\r\n return this._domImage;\r\n }\r\n\r\n private _onImageLoaded(): void {\r\n this._imageDataCache.data = null;\r\n this._imageWidth = this._domImage.width;\r\n this._imageHeight = this._domImage.height;\r\n this._loaded = true;\r\n\r\n if (this._populateNinePatchSlicesFromImage) {\r\n this._extractNinePatchSliceDataFromImage();\r\n }\r\n\r\n if (this._autoScale) {\r\n this.synchronizeSizeWithContent();\r\n }\r\n\r\n this.onImageLoadedObservable.notifyObservers(this);\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the image source url\r\n */\r\n @serialize()\r\n public get source() {\r\n return this._source;\r\n }\r\n\r\n /**\r\n * Resets the internal Image Element cache. Can reduce memory usage.\r\n */\r\n public static ResetImageCache() {\r\n Image.SourceImgCache.clear();\r\n }\r\n\r\n private _removeCacheUsage(source: Nullable<string>) {\r\n const value = source && Image.SourceImgCache.get(source);\r\n if (value) {\r\n value.timesUsed -= 1;\r\n // Since the image isn't being used anymore, we can clean it from the cache\r\n if (value.timesUsed === 0) {\r\n Image.SourceImgCache.delete(source);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets image source url\r\n */\r\n public set source(value: Nullable<string>) {\r\n if (this._urlRewriter && value) {\r\n value = this._urlRewriter(value);\r\n }\r\n\r\n if (this._source === value) {\r\n return;\r\n }\r\n\r\n this._removeCacheUsage(this._source);\r\n\r\n this._loaded = false;\r\n this._source = value;\r\n this._imageDataCache.data = null;\r\n\r\n if (value) {\r\n value = this._svgCheck(value);\r\n }\r\n\r\n // Should abstract platform instead of using LastCreatedEngine\r\n const engine = this._host?.getScene()?.getEngine() || EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n throw new Error(\"Invalid engine. Unable to create a canvas.\");\r\n }\r\n if (value && Image.SourceImgCache.has(value)) {\r\n const cachedData = Image.SourceImgCache.get(value)!;\r\n this._domImage = cachedData.img;\r\n cachedData.timesUsed += 1;\r\n if (cachedData.loaded) {\r\n this._onImageLoaded();\r\n } else {\r\n cachedData.waitingForLoadCallback.push(this._onImageLoaded.bind(this));\r\n }\r\n return;\r\n }\r\n this._domImage = engine.createCanvasImage();\r\n if (value) {\r\n Image.SourceImgCache.set(value, { img: this._domImage, timesUsed: 1, loaded: false, waitingForLoadCallback: [this._onImageLoaded.bind(this)] });\r\n }\r\n\r\n this._domImage.onload = () => {\r\n if (value) {\r\n const cachedData = Image.SourceImgCache.get(value);\r\n if (cachedData) {\r\n cachedData.loaded = true;\r\n for (const waitingCallback of cachedData.waitingForLoadCallback) {\r\n waitingCallback();\r\n }\r\n cachedData.waitingForLoadCallback.length = 0;\r\n return;\r\n }\r\n }\r\n this._onImageLoaded();\r\n };\r\n if (value) {\r\n Tools.SetCorsBehavior(value, this._domImage);\r\n Tools.SetReferrerPolicyBehavior(this.referrerPolicy, this._domImage);\r\n this._domImage.src = value;\r\n }\r\n }\r\n\r\n /**\r\n * Checks for svg document with icon id present\r\n * @param value the source svg\r\n * @returns the svg\r\n */\r\n private _svgCheck(value: string): string {\r\n if (window.SVGSVGElement && value.search(/.svg#/gi) !== -1 && value.indexOf(\"#\") === value.lastIndexOf(\"#\")) {\r\n this._isSVG = true;\r\n const svgsrc = value.split(\"#\")[0];\r\n const elemid = value.split(\"#\")[1];\r\n // check if object alr exist in document\r\n const svgExist = <HTMLObjectElement>document.body.querySelector('object[data=\"' + svgsrc + '\"]');\r\n if (svgExist) {\r\n const svgDoc = svgExist.contentDocument;\r\n // get viewbox width and height, get svg document width and height in px\r\n if (svgDoc && svgDoc.documentElement) {\r\n const vb = svgDoc.documentElement.getAttribute(\"viewBox\");\r\n const docwidth = Number(svgDoc.documentElement.getAttribute(\"width\"));\r\n const docheight = Number(svgDoc.documentElement.getAttribute(\"height\"));\r\n const elem = <SVGGraphicsElement>(<unknown>svgDoc.getElementById(elemid));\r\n if (elem && vb && docwidth && docheight) {\r\n this._getSVGAttribs(svgExist, elemid);\r\n return value;\r\n }\r\n }\r\n\r\n // wait for object to load\r\n svgExist.addEventListener(\"load\", () => {\r\n this._getSVGAttribs(svgExist, elemid);\r\n });\r\n } else {\r\n // create document object\r\n const svgImage = document.createElement(\"object\");\r\n svgImage.data = svgsrc;\r\n svgImage.type = \"image/svg+xml\";\r\n svgImage.width = \"0%\";\r\n svgImage.height = \"0%\";\r\n document.body.appendChild(svgImage);\r\n // when the object has loaded, get the element attribs\r\n svgImage.onload = () => {\r\n const svgobj = <HTMLObjectElement>document.body.querySelector('object[data=\"' + svgsrc + '\"]');\r\n if (svgobj) {\r\n this._getSVGAttribs(svgobj, elemid);\r\n }\r\n };\r\n }\r\n return svgsrc;\r\n } else {\r\n return value;\r\n }\r\n }\r\n\r\n /**\r\n * Sets sourceLeft, sourceTop, sourceWidth, sourceHeight automatically\r\n * given external svg file and icon id\r\n * @param svgsrc\r\n * @param elemid\r\n */\r\n private _getSVGAttribs(svgsrc: HTMLObjectElement, elemid: string) {\r\n const svgDoc = svgsrc.contentDocument;\r\n // get viewbox width and height, get svg document width and height in px\r\n if (svgDoc && svgDoc.documentElement) {\r\n const vb = svgDoc.documentElement.getAttribute(\"viewBox\");\r\n const docwidth = Number(svgDoc.documentElement.getAttribute(\"width\"));\r\n const docheight = Number(svgDoc.documentElement.getAttribute(\"height\"));\r\n // get element bbox and matrix transform\r\n const elem = svgDoc.getElementById(elemid) as Nullable<SVGGraphicsElement>;\r\n if (vb && docwidth && docheight && elem) {\r\n const vb_width = Number(vb.split(\" \")[2]);\r\n const vb_height = Number(vb.split(\" \")[3]);\r\n const elem_bbox = elem.getBBox();\r\n let elem_matrix_a = 1;\r\n let elem_matrix_d = 1;\r\n let elem_matrix_e = 0;\r\n let elem_matrix_f = 0;\r\n const mainMatrix = elem.transform.baseVal.consolidate()!.matrix;\r\n if (elem.transform && elem.transform.baseVal.consolidate()) {\r\n elem_matrix_a = mainMatrix.a;\r\n elem_matrix_d = mainMatrix.d;\r\n elem_matrix_e = mainMatrix.e;\r\n elem_matrix_f = mainMatrix.f;\r\n }\r\n\r\n // compute source coordinates and dimensions\r\n this.sourceLeft = ((elem_matrix_a * elem_bbox.x + elem_matrix_e) * docwidth) / vb_width;\r\n this.sourceTop = ((elem_matrix_d * elem_bbox.y + elem_matrix_f) * docheight) / vb_height;\r\n this.sourceWidth = elem_bbox.width * elem_matrix_a * (docwidth / vb_width);\r\n this.sourceHeight = elem_bbox.height * elem_matrix_d * (docheight / vb_height);\r\n this._svgAttributesComputationCompleted = true;\r\n this.onSVGAttributesComputedObservable.notifyObservers(this);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the cell width to use when animation sheet is enabled\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#image\r\n */\r\n @serialize()\r\n get cellWidth(): number {\r\n return this._cellWidth;\r\n }\r\n set cellWidth(value: number) {\r\n if (this._cellWidth === value) {\r\n return;\r\n }\r\n\r\n this._cellWidth = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the cell height to use when animation sheet is enabled\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#image\r\n */\r\n @serialize()\r\n get cellHeight(): number {\r\n return this._cellHeight;\r\n }\r\n set cellHeight(value: number) {\r\n if (this._cellHeight === value) {\r\n return;\r\n }\r\n\r\n this._cellHeight = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the cell id to use (this will turn on the animation sheet mode)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#image\r\n */\r\n @serialize()\r\n get cellId(): number {\r\n return this._cellId;\r\n }\r\n set cellId(value: number) {\r\n if (this._cellId === value) {\r\n return;\r\n }\r\n\r\n this._cellId = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new Image\r\n * @param name defines the control name\r\n * @param url defines the image url\r\n */\r\n constructor(\r\n public override name?: string,\r\n url: Nullable<string> = null\r\n ) {\r\n super(name);\r\n this.source = url;\r\n }\r\n\r\n /**\r\n * Tests if a given coordinates belong to the current control\r\n * @param x defines x coordinate to test\r\n * @param y defines y coordinate to test\r\n * @returns true if the coordinates are inside the control\r\n */\r\n public override contains(x: number, y: number): boolean {\r\n if (!super.contains(x, y)) {\r\n return false;\r\n }\r\n\r\n if (!this._detectPointerOnOpaqueOnly || !this._workingCanvas) {\r\n return true;\r\n }\r\n\r\n const width = this._currentMeasure.width | 0;\r\n const height = this._currentMeasure.height | 0;\r\n const key = width + \"_\" + height;\r\n\r\n let imageData = this._imageDataCache.data;\r\n\r\n if (!imageData || this._imageDataCache.key !== key) {\r\n const canvas = this._workingCanvas;\r\n const context = canvas.getContext(\"2d\")!;\r\n\r\n this._imageDataCache.data = imageData = context.getImageData(0, 0, width, height).data;\r\n this._imageDataCache.key = key;\r\n }\r\n\r\n x = (x - this._currentMeasure.left) | 0;\r\n y = (y - this._currentMeasure.top) | 0;\r\n\r\n const pickedPixel = imageData[(x + y * width) * 4 + 3];\r\n\r\n return pickedPixel > 0;\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"Image\";\r\n }\r\n\r\n /** Force the control to synchronize with its content */\r\n public synchronizeSizeWithContent() {\r\n if (!this._loaded) {\r\n return;\r\n }\r\n\r\n this.width = this._domImage.width + \"px\";\r\n this.height = this._domImage.height + \"px\";\r\n }\r\n\r\n protected override _processMeasures(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n if (this._loaded) {\r\n switch (this._stretch) {\r\n case Image.STRETCH_NONE:\r\n break;\r\n case Image.STRETCH_FILL:\r\n break;\r\n case Image.STRETCH_UNIFORM:\r\n break;\r\n case Image.STRETCH_NINE_PATCH:\r\n break;\r\n case Image.STRETCH_EXTEND:\r\n if (this._autoScale) {\r\n this.synchronizeSizeWithContent();\r\n }\r\n if (this.parent && this.parent.parent) {\r\n // Will update root size if root is not the top root\r\n this.parent.adaptWidthToChildren = true;\r\n this.parent.adaptHeightToChildren = true;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n super._processMeasures(parentMeasure, context);\r\n }\r\n\r\n private _prepareWorkingCanvasForOpaqueDetection() {\r\n if (!this._detectPointerOnOpaqueOnly) {\r\n return;\r\n }\r\n\r\n const width = this._currentMeasure.width;\r\n const height = this._currentMeasure.height;\r\n\r\n if (!this._workingCanvas) {\r\n const engine = this._host?.getScene()?.getEngine() || EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n throw new Error(\"Invalid engine. Unable to create a canvas.\");\r\n }\r\n this._workingCanvas = engine.createCanvas(width, height);\r\n }\r\n const canvas = this._workingCanvas;\r\n\r\n const context = canvas.getContext(\"2d\")!;\r\n\r\n context.clearRect(0, 0, width, height);\r\n }\r\n\r\n private _drawImage(context: ICanvasRenderingContext, sx: number, sy: number, sw: number, sh: number, tx: number, ty: number, tw: number, th: number) {\r\n context.drawImage(this._domImage, sx, sy, sw, sh, tx, ty, tw, th);\r\n\r\n if (!this._detectPointerOnOpaqueOnly) {\r\n return;\r\n }\r\n\r\n const transform = context.getTransform();\r\n\r\n const canvas = this._workingCanvas!;\r\n const workingCanvasContext = canvas.getContext(\"2d\")!;\r\n workingCanvasContext.save();\r\n const ttx = tx - this._currentMeasure.left;\r\n const tty = ty - this._currentMeasure.top;\r\n workingCanvasContext.setTransform(transform.a, transform.b, transform.c, transform.d, (ttx + tw) / 2, (tty + th) / 2);\r\n workingCanvasContext.translate(-(ttx + tw) / 2, -(tty + th) / 2);\r\n\r\n workingCanvasContext.drawImage(this._domImage, sx, sy, sw, sh, ttx, tty, tw, th);\r\n workingCanvasContext.restore();\r\n }\r\n\r\n public override _draw(context: ICanvasRenderingContext): void {\r\n context.save();\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n let x, y, width, height;\r\n if (this.cellId == -1) {\r\n x = this._sourceLeft;\r\n y = this._sourceTop;\r\n\r\n width = this._sourceWidth ? this._sourceWidth : this._imageWidth;\r\n height = this._sourceHeight ? this._sourceHeight : this._imageHeight;\r\n } else {\r\n const rowCount = this._domImage.naturalWidth / this.cellWidth;\r\n const column = (this.cellId / rowCount) >> 0;\r\n const row = this.cellId % rowCount;\r\n\r\n x = this.cellWidth * row;\r\n y = this.cellHeight * column;\r\n width = this.cellWidth;\r\n height = this.cellHeight;\r\n }\r\n\r\n this._prepareWorkingCanvasForOpaqueDetection();\r\n\r\n this._applyStates(context);\r\n if (this._loaded) {\r\n switch (this._stretch) {\r\n case Image.STRETCH_NONE:\r\n this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n break;\r\n case Image.STRETCH_FILL:\r\n this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n break;\r\n case Image.STRETCH_UNIFORM: {\r\n const hRatio = this._currentMeasure.width / width;\r\n const vRatio = this._currentMeasure.height / height;\r\n const ratio = Math.min(hRatio, vRatio);\r\n const centerX = (this._currentMeasure.width - width * ratio) / 2;\r\n const centerY = (this._currentMeasure.height - height * ratio) / 2;\r\n\r\n this._drawImage(context, x, y, width, height, this._currentMeasure.left + centerX, this._currentMeasure.top + centerY, width * ratio, height * ratio);\r\n break;\r\n }\r\n case Image.STRETCH_EXTEND:\r\n this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n break;\r\n case Image.STRETCH_NINE_PATCH:\r\n this._renderNinePatch(context, x, y, width, height);\r\n break;\r\n }\r\n }\r\n\r\n context.restore();\r\n }\r\n\r\n private _renderNinePatch(context: ICanvasRenderingContext, sx: number, sy: number, sw: number, sh: number): void {\r\n const leftWidth = this._sliceLeft;\r\n const topHeight = this._sliceTop;\r\n const bottomHeight = sh - this._sliceBottom;\r\n const rightWidth = sw - this._sliceRight;\r\n const centerWidth = this._sliceRight - this._sliceLeft;\r\n const centerHeight = this._sliceBottom - this._sliceTop;\r\n const targetCenterWidth = this._currentMeasure.width - rightWidth - leftWidth + 2;\r\n const targetCenterHeight = this._currentMeasure.height - bottomHeight - topHeight + 2;\r\n const centerLeftOffset = this._currentMeasure.left + leftWidth - 1;\r\n const centerTopOffset = this._currentMeasure.top + topHeight - 1;\r\n const rightOffset = this._currentMeasure.left + this._currentMeasure.width - rightWidth;\r\n const bottomOffset = this._currentMeasure.top + this._currentMeasure.height - bottomHeight;\r\n\r\n //Top Left\r\n this._drawImage(context, sx, sy, leftWidth, topHeight, this._currentMeasure.left, this._currentMeasure.top, leftWidth, topHeight);\r\n //Top\r\n this._drawImage(context, sx + this._sliceLeft, sy, centerWidth, topHeight, centerLeftOffset + 1, this._currentMeasure.top, targetCenterWidth - 2, topHeight);\r\n //Top Right\r\n this._drawImage(context, sx + this._sliceRight, sy, rightWidth, topHeight, rightOffset, this._currentMeasure.top, rightWidth, topHeight);\r\n //Left\r\n this._drawImage(context, sx, sy + this._sliceTop, leftWidth, centerHeight, this._currentMeasure.left, centerTopOffset + 1, leftWidth, targetCenterHeight - 2);\r\n // Center\r\n this._drawImage(context, sx + this._sliceLeft, sy + this._sliceTop, centerWidth, centerHeight, centerLeftOffset, centerTopOffset, targetCenterWidth, targetCenterHeight);\r\n //Right\r\n this._drawImage(context, sx + this._sliceRight, sy + this._sliceTop, rightWidth, centerHeight, rightOffset, centerTopOffset + 1, rightWidth, targetCenterHeight - 2);\r\n //Bottom Left\r\n this._drawImage(context, sx, sy + this._sliceBottom, leftWidth, bottomHeight, this._currentMeasure.left, bottomOffset, leftWidth, bottomHeight);\r\n //Bottom\r\n this._drawImage(context, sx + this.sliceLeft, sy + this._sliceBottom, centerWidth, bottomHeight, centerLeftOffset + 1, bottomOffset, targetCenterWidth - 2, bottomHeight);\r\n //Bottom Right\r\n this._drawImage(context, sx + this._sliceRight, sy + this._sliceBottom, rightWidth, bottomHeight, rightOffset, bottomOffset, rightWidth, bottomHeight);\r\n }\r\n\r\n public override dispose() {\r\n super.dispose();\r\n this.onImageLoadedObservable.clear();\r\n this.onSVGAttributesComputedObservable.clear();\r\n this._removeCacheUsage(this._source);\r\n }\r\n\r\n // Static\r\n /** STRETCH_NONE */\r\n public static readonly STRETCH_NONE = 0;\r\n /** STRETCH_FILL */\r\n public static readonly STRETCH_FILL = 1;\r\n /** STRETCH_UNIFORM */\r\n public static readonly STRETCH_UNIFORM = 2;\r\n /** STRETCH_EXTEND */\r\n public static readonly STRETCH_EXTEND = 3;\r\n /** NINE_PATCH */\r\n public static readonly STRETCH_NINE_PATCH = 4;\r\n}\r\nRegisterClass(\"BABYLON.GUI.Image\", Image);\r\n"]}
1
+ {"version":3,"file":"image.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/image.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,KAAK,EAAE,sCAAwB;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAEjD,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,OAAO;IA8D9B;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEe,OAAO;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED;;;OAGG;IAEH,IAAW,yBAAyB;QAChC,OAAO,IAAI,CAAC,0BAA0B,CAAC;IAC3C,CAAC;IAED,IAAW,yBAAyB,CAAC,KAAc;QAC/C,IAAI,IAAI,CAAC,0BAA0B,KAAK,KAAK,EAAE;YAC3C,OAAO;SACV;QAED,IAAI,CAAC,0BAA0B,GAAG,KAAK,CAAC;IAC5C,CAAC;IAED;;OAEG;IAEH,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,IAAW,SAAS,CAAC,KAAa;QAC9B,IAAI,IAAI,CAAC,UAAU,KAAK,KAAK,EAAE;YAC3B,OAAO;SACV;QAED,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IAEH,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,IAAW,UAAU,CAAC,KAAa;QA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QACrC,IAAI,CAAC,iCAAiC,CAAC,KAAK,EAAE,CAAC;QAC/C,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;;AAp8BD;;GAEG;AACW,oBAAc,GAAG,IAAI,GAAG,EAA0G,AAApH,CAAqH;AAm8BjJ,SAAS;AACT,mBAAmB;AACI,kBAAY,GAAG,CAAC,AAAJ,CAAK;AACxC,mBAAmB;AACI,kBAAY,GAAG,CAAC,AAAJ,CAAK;AACxC,sBAAsB;AACC,qBAAe,GAAG,CAAC,AAAJ,CAAK;AAC3C,qBAAqB;AACE,oBAAc,GAAG,CAAC,AAAJ,CAAK;AAC1C,iBAAiB;AACM,wBAAkB,GAAG,CAAC,AAAJ,CAAK;AA36B9C;IADC,SAAS,EAAE;sDAGX;AAcD;IADC,SAAS,EAAE;sCAGX;AAgBD;IADC,SAAS,EAAE;uCAGX;AAgBD;IADC,SAAS,EAAE;qCAGX;AAgBD;IADC,SAAS,EAAE;wCAGX;AAgBD;IADC,SAAS,EAAE;uCAGX;AAgBD;IADC,SAAS,EAAE;sCAGX;AAgBD;IADC,SAAS,EAAE;wCAGX;AAgBD;IADC,SAAS,EAAE;yCAGX;AA8BD;IADC,SAAS,EAAE;6DAGX;AA6BD;IADC,SAAS,EAAE;sCAGX;AAgBD;IADC,SAAS,EAAE;oCAGX;AAsMD;IADC,SAAS,EAAE;mCAGX;AAuLD;IADC,SAAS,EAAE;sCAGX;AAeD;IADC,SAAS,EAAE;uCAGX;AAeD;IADC,SAAS,EAAE;mCAGX;AAySL,aAAa,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Tools } from \"core/Misc/tools\";\r\n\r\nimport { Control } from \"./control\";\r\nimport type { Measure } from \"../measure\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvas, ICanvasRenderingContext, IImage } from \"core/Engines/ICanvas\";\r\nimport { EngineStore } from \"core/Engines/engineStore\";\r\n\r\n/**\r\n * Class used to create 2D images\r\n */\r\nexport class Image extends Control {\r\n /**\r\n * Specifies an alternate text for the image, if the image for some reason cannot be displayed.\r\n */\r\n public alt?: string;\r\n\r\n private _workingCanvas: Nullable<ICanvas> = null;\r\n\r\n private _domImage: IImage;\r\n private _imageWidth: number;\r\n private _imageHeight: number;\r\n private _loaded = false;\r\n private _stretch = Image.STRETCH_FILL;\r\n private _source: Nullable<string>;\r\n private _autoScale = false;\r\n\r\n private _sourceLeft = 0;\r\n private _sourceTop = 0;\r\n private _sourceWidth = 0;\r\n private _sourceHeight = 0;\r\n private _svgAttributesComputationCompleted: boolean = false;\r\n private _isSVG: boolean = false;\r\n\r\n private _cellWidth: number = 0;\r\n private _cellHeight: number = 0;\r\n private _cellId: number = -1;\r\n\r\n private _sliceLeft: number;\r\n private _sliceRight: number;\r\n private _sliceTop: number;\r\n private _sliceBottom: number;\r\n\r\n private _populateNinePatchSlicesFromImage = false;\r\n\r\n private _detectPointerOnOpaqueOnly: boolean;\r\n\r\n private _imageDataCache: {\r\n data: Uint8ClampedArray | null;\r\n key: string;\r\n } = { data: null, key: \"\" };\r\n\r\n /**\r\n * Cache of images to avoid loading the same image multiple times\r\n */\r\n public static SourceImgCache = new Map<string, { img: IImage; timesUsed: number; loaded: boolean; waitingForLoadCallback: Array<() => void> }>();\r\n\r\n /**\r\n * Observable notified when the content is loaded\r\n */\r\n public onImageLoadedObservable = new Observable<Image>();\r\n\r\n /**\r\n * Observable notified when _sourceLeft, _sourceTop, _sourceWidth and _sourceHeight are computed\r\n */\r\n public onSVGAttributesComputedObservable = new Observable<Image>();\r\n\r\n /**\r\n * Gets or sets the referrer policy to apply on the img element load request.\r\n * You should set referrerPolicy before set the source of the image if you want to ensure the header will be present on the xhr loading request\r\n */\r\n public referrerPolicy: Nullable<ReferrerPolicy>;\r\n\r\n /**\r\n * Gets a boolean indicating that the content is loaded\r\n */\r\n public get isLoaded(): boolean {\r\n return this._loaded;\r\n }\r\n\r\n public override isReady(): boolean {\r\n return this.isLoaded;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if pointers should only be validated on pixels with alpha > 0.\r\n * Beware using this as this will consume more memory as the image has to be stored twice\r\n */\r\n @serialize()\r\n public get detectPointerOnOpaqueOnly(): boolean {\r\n return this._detectPointerOnOpaqueOnly;\r\n }\r\n\r\n public set detectPointerOnOpaqueOnly(value: boolean) {\r\n if (this._detectPointerOnOpaqueOnly === value) {\r\n return;\r\n }\r\n\r\n this._detectPointerOnOpaqueOnly = value;\r\n }\r\n\r\n /**\r\n * Gets or sets the left value for slicing (9-patch)\r\n */\r\n @serialize()\r\n public get sliceLeft(): number {\r\n return this._sliceLeft;\r\n }\r\n\r\n public set sliceLeft(value: number) {\r\n if (this._sliceLeft === value) {\r\n return;\r\n }\r\n\r\n this._sliceLeft = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the right value for slicing (9-patch)\r\n */\r\n @serialize()\r\n public get sliceRight(): number {\r\n return this._sliceRight;\r\n }\r\n\r\n public set sliceRight(value: number) {\r\n if (this._sliceRight === value) {\r\n return;\r\n }\r\n\r\n this._sliceRight = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the top value for slicing (9-patch)\r\n */\r\n @serialize()\r\n public get sliceTop(): number {\r\n return this._sliceTop;\r\n }\r\n\r\n public set sliceTop(value: number) {\r\n if (this._sliceTop === value) {\r\n return;\r\n }\r\n\r\n this._sliceTop = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the bottom value for slicing (9-patch)\r\n */\r\n @serialize()\r\n public get sliceBottom(): number {\r\n return this._sliceBottom;\r\n }\r\n\r\n public set sliceBottom(value: number) {\r\n if (this._sliceBottom === value) {\r\n return;\r\n }\r\n\r\n this._sliceBottom = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the left coordinate in the source image\r\n */\r\n @serialize()\r\n public get sourceLeft(): number {\r\n return this._sourceLeft;\r\n }\r\n\r\n public set sourceLeft(value: number) {\r\n if (this._sourceLeft === value) {\r\n return;\r\n }\r\n\r\n this._sourceLeft = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the top coordinate in the source image\r\n */\r\n @serialize()\r\n public get sourceTop(): number {\r\n return this._sourceTop;\r\n }\r\n\r\n public set sourceTop(value: number) {\r\n if (this._sourceTop === value) {\r\n return;\r\n }\r\n\r\n this._sourceTop = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the width to capture in the source image\r\n */\r\n @serialize()\r\n public get sourceWidth(): number {\r\n return this._sourceWidth;\r\n }\r\n\r\n public set sourceWidth(value: number) {\r\n if (this._sourceWidth === value) {\r\n return;\r\n }\r\n\r\n this._sourceWidth = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the height to capture in the source image\r\n */\r\n @serialize()\r\n public get sourceHeight(): number {\r\n return this._sourceHeight;\r\n }\r\n\r\n public set sourceHeight(value: number) {\r\n if (this._sourceHeight === value) {\r\n return;\r\n }\r\n\r\n this._sourceHeight = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the image width\r\n */\r\n public get imageWidth(): number {\r\n return this._imageWidth;\r\n }\r\n\r\n /**\r\n * Gets the image height\r\n */\r\n public get imageHeight(): number {\r\n return this._imageHeight;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if nine patch slices (left, top, right, bottom) should be read from image data\r\n */\r\n @serialize()\r\n public get populateNinePatchSlicesFromImage(): boolean {\r\n return this._populateNinePatchSlicesFromImage;\r\n }\r\n\r\n public set populateNinePatchSlicesFromImage(value: boolean) {\r\n if (this._populateNinePatchSlicesFromImage === value) {\r\n return;\r\n }\r\n\r\n this._populateNinePatchSlicesFromImage = value;\r\n\r\n if (this._populateNinePatchSlicesFromImage && this._loaded) {\r\n this._extractNinePatchSliceDataFromImage();\r\n }\r\n }\r\n\r\n /** Indicates if the format of the image is SVG */\r\n public get isSVG(): boolean {\r\n return this._isSVG;\r\n }\r\n\r\n /** Gets the status of the SVG attributes computation (sourceLeft, sourceTop, sourceWidth, sourceHeight) */\r\n public get svgAttributesComputationCompleted(): boolean {\r\n return this._svgAttributesComputationCompleted;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the image can force its container to adapt its size\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#image\r\n */\r\n @serialize()\r\n public get autoScale(): boolean {\r\n return this._autoScale;\r\n }\r\n\r\n public set autoScale(value: boolean) {\r\n if (this._autoScale === value) {\r\n return;\r\n }\r\n\r\n this._autoScale = value;\r\n\r\n if (value && this._loaded) {\r\n this.synchronizeSizeWithContent();\r\n }\r\n }\r\n\r\n /** Gets or sets the stretching mode used by the image */\r\n @serialize()\r\n public get stretch(): number {\r\n return this._stretch;\r\n }\r\n\r\n public set stretch(value: number) {\r\n if (this._stretch === value) {\r\n return;\r\n }\r\n\r\n this._stretch = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _rotate90(n: number, preserveProperties: boolean = false): Image {\r\n const width = this._domImage.width;\r\n const height = this._domImage.height;\r\n\r\n // Should abstract platform instead of using LastCreatedEngine\r\n const engine = this._host?.getScene()?.getEngine() || EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n throw new Error(\"Invalid engine. Unable to create a canvas.\");\r\n }\r\n const canvas = engine.createCanvas(height, width);\r\n\r\n const context = canvas.getContext(\"2d\")!;\r\n\r\n context.translate(canvas.width / 2, canvas.height / 2);\r\n context.rotate((n * Math.PI) / 2);\r\n\r\n context.drawImage(this._domImage, 0, 0, width, height, -width / 2, -height / 2, width, height);\r\n\r\n const dataUrl: string = canvas.toDataURL(\"image/jpg\");\r\n const rotatedImage = new Image(this.name + \"rotated\", dataUrl);\r\n\r\n if (preserveProperties) {\r\n rotatedImage._stretch = this._stretch;\r\n rotatedImage._autoScale = this._autoScale;\r\n rotatedImage._cellId = this._cellId;\r\n rotatedImage._cellWidth = n % 1 ? this._cellHeight : this._cellWidth;\r\n rotatedImage._cellHeight = n % 1 ? this._cellWidth : this._cellHeight;\r\n }\r\n\r\n this._handleRotationForSVGImage(this, rotatedImage, n);\r\n\r\n this._imageDataCache.data = null;\r\n\r\n return rotatedImage;\r\n }\r\n\r\n private _handleRotationForSVGImage(srcImage: Image, dstImage: Image, n: number): void {\r\n if (!srcImage._isSVG) {\r\n return;\r\n }\r\n\r\n if (srcImage._svgAttributesComputationCompleted) {\r\n this._rotate90SourceProperties(srcImage, dstImage, n);\r\n this._markAsDirty();\r\n } else {\r\n srcImage.onSVGAttributesComputedObservable.addOnce(() => {\r\n this._rotate90SourceProperties(srcImage, dstImage, n);\r\n this._markAsDirty();\r\n });\r\n }\r\n }\r\n\r\n private _rotate90SourceProperties(srcImage: Image, dstImage: Image, n: number): void {\r\n let srcLeft = srcImage.sourceLeft,\r\n srcTop = srcImage.sourceTop,\r\n srcWidth = srcImage.domImage.width,\r\n srcHeight = srcImage.domImage.height;\r\n\r\n let dstLeft = srcLeft,\r\n dstTop = srcTop,\r\n dstWidth = srcImage.sourceWidth,\r\n dstHeight = srcImage.sourceHeight;\r\n\r\n if (n != 0) {\r\n const mult = n < 0 ? -1 : 1;\r\n n = n % 4;\r\n for (let i = 0; i < Math.abs(n); ++i) {\r\n dstLeft = -(srcTop - srcHeight / 2) * mult + srcHeight / 2;\r\n dstTop = (srcLeft - srcWidth / 2) * mult + srcWidth / 2;\r\n [dstWidth, dstHeight] = [dstHeight, dstWidth];\r\n if (n < 0) {\r\n dstTop -= dstHeight;\r\n } else {\r\n dstLeft -= dstWidth;\r\n }\r\n srcLeft = dstLeft;\r\n srcTop = dstTop;\r\n [srcWidth, srcHeight] = [srcHeight, srcWidth];\r\n }\r\n }\r\n\r\n dstImage.sourceLeft = dstLeft;\r\n dstImage.sourceTop = dstTop;\r\n dstImage.sourceWidth = dstWidth;\r\n dstImage.sourceHeight = dstHeight;\r\n }\r\n\r\n private _extractNinePatchSliceDataFromImage() {\r\n const width = this._domImage.width;\r\n const height = this._domImage.height;\r\n\r\n if (!this._workingCanvas) {\r\n const engine = this._host?.getScene()?.getEngine() || EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n throw new Error(\"Invalid engine. Unable to create a canvas.\");\r\n }\r\n this._workingCanvas = engine.createCanvas(width, height);\r\n }\r\n const canvas = this._workingCanvas;\r\n const context = canvas.getContext(\"2d\")!;\r\n\r\n context.drawImage(this._domImage, 0, 0, width, height);\r\n const imageData = context.getImageData(0, 0, width, height);\r\n\r\n // Left and right\r\n this._sliceLeft = -1;\r\n this._sliceRight = -1;\r\n for (let x = 0; x < width; x++) {\r\n const alpha = imageData.data[x * 4 + 3];\r\n\r\n if (alpha > 127 && this._sliceLeft === -1) {\r\n this._sliceLeft = x;\r\n continue;\r\n }\r\n\r\n if (alpha < 127 && this._sliceLeft > -1) {\r\n this._sliceRight = x;\r\n break;\r\n }\r\n }\r\n\r\n // top and bottom\r\n this._sliceTop = -1;\r\n this._sliceBottom = -1;\r\n for (let y = 0; y < height; y++) {\r\n const alpha = imageData.data[y * width * 4 + 3];\r\n\r\n if (alpha > 127 && this._sliceTop === -1) {\r\n this._sliceTop = y;\r\n continue;\r\n }\r\n\r\n if (alpha < 127 && this._sliceTop > -1) {\r\n this._sliceBottom = y;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the internal DOM image used to render the control\r\n */\r\n public set domImage(value: IImage) {\r\n this._domImage = value;\r\n this._loaded = false;\r\n this._imageDataCache.data = null;\r\n\r\n if (this._domImage.width) {\r\n this._onImageLoaded();\r\n } else {\r\n this._domImage.onload = () => {\r\n this._onImageLoaded();\r\n };\r\n }\r\n }\r\n\r\n public get domImage(): IImage {\r\n return this._domImage;\r\n }\r\n\r\n private _onImageLoaded(): void {\r\n this._imageDataCache.data = null;\r\n this._imageWidth = this._domImage.width;\r\n this._imageHeight = this._domImage.height;\r\n this._loaded = true;\r\n\r\n if (this._populateNinePatchSlicesFromImage) {\r\n this._extractNinePatchSliceDataFromImage();\r\n }\r\n\r\n if (this._autoScale) {\r\n this.synchronizeSizeWithContent();\r\n }\r\n\r\n this.onImageLoadedObservable.notifyObservers(this);\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the image source url\r\n */\r\n @serialize()\r\n public get source() {\r\n return this._source;\r\n }\r\n\r\n /**\r\n * Resets the internal Image Element cache. Can reduce memory usage.\r\n */\r\n public static ResetImageCache() {\r\n Image.SourceImgCache.clear();\r\n }\r\n\r\n private _removeCacheUsage(source: Nullable<string>) {\r\n const value = source && Image.SourceImgCache.get(source);\r\n if (value) {\r\n value.timesUsed -= 1;\r\n // Since the image isn't being used anymore, we can clean it from the cache\r\n if (value.timesUsed === 0) {\r\n Image.SourceImgCache.delete(source);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets image source url\r\n */\r\n public set source(value: Nullable<string>) {\r\n if (this._urlRewriter && value) {\r\n value = this._urlRewriter(value);\r\n }\r\n\r\n if (this._source === value) {\r\n return;\r\n }\r\n\r\n this._removeCacheUsage(this._source);\r\n\r\n this._loaded = false;\r\n this._source = value;\r\n this._imageDataCache.data = null;\r\n\r\n if (value) {\r\n value = this._svgCheck(value);\r\n }\r\n\r\n // Should abstract platform instead of using LastCreatedEngine\r\n const engine = this._host?.getScene()?.getEngine() || EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n throw new Error(\"Invalid engine. Unable to create a canvas.\");\r\n }\r\n if (value && Image.SourceImgCache.has(value)) {\r\n const cachedData = Image.SourceImgCache.get(value)!;\r\n this._domImage = cachedData.img;\r\n cachedData.timesUsed += 1;\r\n if (cachedData.loaded) {\r\n this._onImageLoaded();\r\n } else {\r\n cachedData.waitingForLoadCallback.push(this._onImageLoaded.bind(this));\r\n }\r\n return;\r\n }\r\n this._domImage = engine.createCanvasImage();\r\n if (value) {\r\n Image.SourceImgCache.set(value, { img: this._domImage, timesUsed: 1, loaded: false, waitingForLoadCallback: [this._onImageLoaded.bind(this)] });\r\n }\r\n\r\n this._domImage.onload = () => {\r\n if (value) {\r\n const cachedData = Image.SourceImgCache.get(value);\r\n if (cachedData) {\r\n cachedData.loaded = true;\r\n for (const waitingCallback of cachedData.waitingForLoadCallback) {\r\n waitingCallback();\r\n }\r\n cachedData.waitingForLoadCallback.length = 0;\r\n return;\r\n }\r\n }\r\n this._onImageLoaded();\r\n };\r\n if (value) {\r\n Tools.SetCorsBehavior(value, this._domImage);\r\n Tools.SetReferrerPolicyBehavior(this.referrerPolicy, this._domImage);\r\n this._domImage.src = value;\r\n }\r\n }\r\n\r\n /**\r\n * Checks for svg document with icon id present\r\n * @param value the source svg\r\n * @returns the svg\r\n */\r\n private _svgCheck(value: string): string {\r\n if (window.SVGSVGElement && value.search(/.svg#/gi) !== -1 && value.indexOf(\"#\") === value.lastIndexOf(\"#\")) {\r\n this._isSVG = true;\r\n const svgsrc = value.split(\"#\")[0];\r\n const elemid = value.split(\"#\")[1];\r\n // check if object alr exist in document\r\n const svgExist = <HTMLObjectElement>document.body.querySelector('object[data=\"' + svgsrc + '\"]');\r\n if (svgExist) {\r\n const svgDoc = svgExist.contentDocument;\r\n // get viewbox width and height, get svg document width and height in px\r\n if (svgDoc && svgDoc.documentElement) {\r\n const vb = svgDoc.documentElement.getAttribute(\"viewBox\");\r\n const docwidth = Number(svgDoc.documentElement.getAttribute(\"width\"));\r\n const docheight = Number(svgDoc.documentElement.getAttribute(\"height\"));\r\n const elem = <SVGGraphicsElement>(<unknown>svgDoc.getElementById(elemid));\r\n if (elem && vb && docwidth && docheight) {\r\n this._getSVGAttribs(svgExist, elemid);\r\n return value;\r\n }\r\n }\r\n\r\n // wait for object to load\r\n svgExist.addEventListener(\"load\", () => {\r\n this._getSVGAttribs(svgExist, elemid);\r\n });\r\n } else {\r\n // create document object\r\n const svgImage = document.createElement(\"object\");\r\n svgImage.data = svgsrc;\r\n svgImage.type = \"image/svg+xml\";\r\n svgImage.width = \"0%\";\r\n svgImage.height = \"0%\";\r\n document.body.appendChild(svgImage);\r\n // when the object has loaded, get the element attribs\r\n svgImage.onload = () => {\r\n const svgobj = <HTMLObjectElement>document.body.querySelector('object[data=\"' + svgsrc + '\"]');\r\n if (svgobj) {\r\n this._getSVGAttribs(svgobj, elemid);\r\n }\r\n };\r\n }\r\n return svgsrc;\r\n } else {\r\n return value;\r\n }\r\n }\r\n\r\n /**\r\n * Sets sourceLeft, sourceTop, sourceWidth, sourceHeight automatically\r\n * given external svg file and icon id\r\n * @param svgsrc\r\n * @param elemid\r\n */\r\n private _getSVGAttribs(svgsrc: HTMLObjectElement, elemid: string) {\r\n const svgDoc = svgsrc.contentDocument;\r\n // get viewbox width and height, get svg document width and height in px\r\n if (svgDoc && svgDoc.documentElement) {\r\n const vb = svgDoc.documentElement.getAttribute(\"viewBox\");\r\n const docwidth = Number(svgDoc.documentElement.getAttribute(\"width\"));\r\n const docheight = Number(svgDoc.documentElement.getAttribute(\"height\"));\r\n // get element bbox and matrix transform\r\n const elem = svgDoc.getElementById(elemid) as Nullable<SVGGraphicsElement>;\r\n if (vb && docwidth && docheight && elem) {\r\n const vb_width = Number(vb.split(\" \")[2]);\r\n const vb_height = Number(vb.split(\" \")[3]);\r\n const elem_bbox = elem.getBBox();\r\n let elem_matrix_a = 1;\r\n let elem_matrix_d = 1;\r\n let elem_matrix_e = 0;\r\n let elem_matrix_f = 0;\r\n const mainMatrix = elem.transform.baseVal.consolidate()!.matrix;\r\n if (elem.transform && elem.transform.baseVal.consolidate()) {\r\n elem_matrix_a = mainMatrix.a;\r\n elem_matrix_d = mainMatrix.d;\r\n elem_matrix_e = mainMatrix.e;\r\n elem_matrix_f = mainMatrix.f;\r\n }\r\n\r\n // compute source coordinates and dimensions\r\n this.sourceLeft = ((elem_matrix_a * elem_bbox.x + elem_matrix_e) * docwidth) / vb_width;\r\n this.sourceTop = ((elem_matrix_d * elem_bbox.y + elem_matrix_f) * docheight) / vb_height;\r\n this.sourceWidth = elem_bbox.width * elem_matrix_a * (docwidth / vb_width);\r\n this.sourceHeight = elem_bbox.height * elem_matrix_d * (docheight / vb_height);\r\n this._svgAttributesComputationCompleted = true;\r\n this.onSVGAttributesComputedObservable.notifyObservers(this);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the cell width to use when animation sheet is enabled\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#image\r\n */\r\n @serialize()\r\n get cellWidth(): number {\r\n return this._cellWidth;\r\n }\r\n set cellWidth(value: number) {\r\n if (this._cellWidth === value) {\r\n return;\r\n }\r\n\r\n this._cellWidth = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the cell height to use when animation sheet is enabled\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#image\r\n */\r\n @serialize()\r\n get cellHeight(): number {\r\n return this._cellHeight;\r\n }\r\n set cellHeight(value: number) {\r\n if (this._cellHeight === value) {\r\n return;\r\n }\r\n\r\n this._cellHeight = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the cell id to use (this will turn on the animation sheet mode)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#image\r\n */\r\n @serialize()\r\n get cellId(): number {\r\n return this._cellId;\r\n }\r\n set cellId(value: number) {\r\n if (this._cellId === value) {\r\n return;\r\n }\r\n\r\n this._cellId = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new Image\r\n * @param name defines the control name\r\n * @param url defines the image url\r\n */\r\n constructor(\r\n public override name?: string,\r\n url: Nullable<string> = null\r\n ) {\r\n super(name);\r\n this.source = url;\r\n }\r\n\r\n /**\r\n * Tests if a given coordinates belong to the current control\r\n * @param x defines x coordinate to test\r\n * @param y defines y coordinate to test\r\n * @returns true if the coordinates are inside the control\r\n */\r\n public override contains(x: number, y: number): boolean {\r\n if (!super.contains(x, y)) {\r\n return false;\r\n }\r\n\r\n if (!this._detectPointerOnOpaqueOnly || !this._workingCanvas) {\r\n return true;\r\n }\r\n\r\n const width = this._currentMeasure.width | 0;\r\n const height = this._currentMeasure.height | 0;\r\n const key = width + \"_\" + height;\r\n\r\n let imageData = this._imageDataCache.data;\r\n\r\n if (!imageData || this._imageDataCache.key !== key) {\r\n const canvas = this._workingCanvas;\r\n const context = canvas.getContext(\"2d\")!;\r\n\r\n this._imageDataCache.data = imageData = context.getImageData(0, 0, width, height).data;\r\n this._imageDataCache.key = key;\r\n }\r\n\r\n x = (x - this._currentMeasure.left) | 0;\r\n y = (y - this._currentMeasure.top) | 0;\r\n\r\n const pickedPixel = imageData[(x + y * width) * 4 + 3];\r\n\r\n return pickedPixel > 0;\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"Image\";\r\n }\r\n\r\n /** Force the control to synchronize with its content */\r\n public synchronizeSizeWithContent() {\r\n if (!this._loaded) {\r\n return;\r\n }\r\n\r\n this.width = this._domImage.width + \"px\";\r\n this.height = this._domImage.height + \"px\";\r\n }\r\n\r\n protected override _processMeasures(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n if (this._loaded) {\r\n switch (this._stretch) {\r\n case Image.STRETCH_NONE:\r\n break;\r\n case Image.STRETCH_FILL:\r\n break;\r\n case Image.STRETCH_UNIFORM:\r\n break;\r\n case Image.STRETCH_NINE_PATCH:\r\n break;\r\n case Image.STRETCH_EXTEND:\r\n if (this._autoScale) {\r\n this.synchronizeSizeWithContent();\r\n }\r\n if (this.parent && this.parent.parent) {\r\n // Will update root size if root is not the top root\r\n this.parent.adaptWidthToChildren = true;\r\n this.parent.adaptHeightToChildren = true;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n super._processMeasures(parentMeasure, context);\r\n }\r\n\r\n private _prepareWorkingCanvasForOpaqueDetection() {\r\n if (!this._detectPointerOnOpaqueOnly) {\r\n return;\r\n }\r\n\r\n const width = this._currentMeasure.width;\r\n const height = this._currentMeasure.height;\r\n\r\n if (!this._workingCanvas) {\r\n const engine = this._host?.getScene()?.getEngine() || EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n throw new Error(\"Invalid engine. Unable to create a canvas.\");\r\n }\r\n this._workingCanvas = engine.createCanvas(width, height);\r\n }\r\n const canvas = this._workingCanvas;\r\n\r\n const context = canvas.getContext(\"2d\")!;\r\n\r\n context.clearRect(0, 0, width, height);\r\n }\r\n\r\n private _drawImage(context: ICanvasRenderingContext, sx: number, sy: number, sw: number, sh: number, tx: number, ty: number, tw: number, th: number) {\r\n context.drawImage(this._domImage, sx, sy, sw, sh, tx, ty, tw, th);\r\n\r\n if (!this._detectPointerOnOpaqueOnly) {\r\n return;\r\n }\r\n\r\n const transform = context.getTransform();\r\n\r\n const canvas = this._workingCanvas!;\r\n const workingCanvasContext = canvas.getContext(\"2d\")!;\r\n workingCanvasContext.save();\r\n const ttx = tx - this._currentMeasure.left;\r\n const tty = ty - this._currentMeasure.top;\r\n workingCanvasContext.setTransform(transform.a, transform.b, transform.c, transform.d, (ttx + tw) / 2, (tty + th) / 2);\r\n workingCanvasContext.translate(-(ttx + tw) / 2, -(tty + th) / 2);\r\n\r\n workingCanvasContext.drawImage(this._domImage, sx, sy, sw, sh, ttx, tty, tw, th);\r\n workingCanvasContext.restore();\r\n }\r\n\r\n public override _draw(context: ICanvasRenderingContext): void {\r\n context.save();\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n let x, y, width, height;\r\n if (this.cellId == -1) {\r\n x = this._sourceLeft;\r\n y = this._sourceTop;\r\n\r\n width = this._sourceWidth ? this._sourceWidth : this._imageWidth;\r\n height = this._sourceHeight ? this._sourceHeight : this._imageHeight;\r\n } else {\r\n const rowCount = this._domImage.naturalWidth / this.cellWidth;\r\n const column = (this.cellId / rowCount) >> 0;\r\n const row = this.cellId % rowCount;\r\n\r\n x = this.cellWidth * row;\r\n y = this.cellHeight * column;\r\n width = this.cellWidth;\r\n height = this.cellHeight;\r\n }\r\n\r\n this._prepareWorkingCanvasForOpaqueDetection();\r\n\r\n this._applyStates(context);\r\n if (this._loaded) {\r\n switch (this._stretch) {\r\n case Image.STRETCH_NONE:\r\n this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n break;\r\n case Image.STRETCH_FILL:\r\n this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n break;\r\n case Image.STRETCH_UNIFORM: {\r\n const hRatio = this._currentMeasure.width / width;\r\n const vRatio = this._currentMeasure.height / height;\r\n const ratio = Math.min(hRatio, vRatio);\r\n const centerX = (this._currentMeasure.width - width * ratio) / 2;\r\n const centerY = (this._currentMeasure.height - height * ratio) / 2;\r\n\r\n this._drawImage(context, x, y, width, height, this._currentMeasure.left + centerX, this._currentMeasure.top + centerY, width * ratio, height * ratio);\r\n break;\r\n }\r\n case Image.STRETCH_EXTEND:\r\n this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n break;\r\n case Image.STRETCH_NINE_PATCH:\r\n this._renderNinePatch(context, x, y, width, height);\r\n break;\r\n }\r\n }\r\n\r\n context.restore();\r\n }\r\n\r\n private _renderNinePatch(context: ICanvasRenderingContext, sx: number, sy: number, sw: number, sh: number): void {\r\n const idealRatio = this.host.idealWidth\r\n ? this._width.getValue(this.host) / this.host.idealWidth\r\n : this.host.idealHeight\r\n ? this._height.getValue(this.host) / this.host.idealHeight\r\n : 1;\r\n const leftWidth = this._sliceLeft;\r\n const topHeight = this._sliceTop;\r\n const bottomHeight = sh - this._sliceBottom;\r\n const rightWidth = sw - this._sliceRight;\r\n const centerWidth = this._sliceRight - this._sliceLeft;\r\n const centerHeight = this._sliceBottom - this._sliceTop;\r\n const leftWidthAdjusted = Math.round(leftWidth * idealRatio);\r\n const topHeightAdjusted = Math.round(topHeight * idealRatio);\r\n const bottomHeightAdjusted = Math.round(bottomHeight * idealRatio);\r\n const rightWidthAdjusted = Math.round(rightWidth * idealRatio);\r\n const targetCenterWidth = Math.round(this._currentMeasure.width) - rightWidthAdjusted - leftWidthAdjusted + 2;\r\n const targetCenterHeight = Math.round(this._currentMeasure.height) - bottomHeightAdjusted - topHeightAdjusted + 2;\r\n const centerLeftOffset = Math.round(this._currentMeasure.left) + leftWidthAdjusted - 1;\r\n const centerTopOffset = Math.round(this._currentMeasure.top) + topHeightAdjusted - 1;\r\n const rightOffset = Math.round(this._currentMeasure.left + this._currentMeasure.width) - rightWidthAdjusted;\r\n const bottomOffset = Math.round(this._currentMeasure.top + this._currentMeasure.height) - bottomHeightAdjusted;\r\n\r\n //Top Left\r\n this._drawImage(context, sx, sy, leftWidth, topHeight, this._currentMeasure.left, this._currentMeasure.top, leftWidthAdjusted, topHeightAdjusted);\r\n //Top\r\n this._drawImage(context, sx + this._sliceLeft, sy, centerWidth, topHeight, centerLeftOffset + 1, this._currentMeasure.top, targetCenterWidth - 2, topHeightAdjusted);\r\n //Top Right\r\n this._drawImage(context, sx + this._sliceRight, sy, rightWidth, topHeight, rightOffset, this._currentMeasure.top, rightWidthAdjusted, topHeightAdjusted);\r\n //Left\r\n this._drawImage(context, sx, sy + this._sliceTop, leftWidth, centerHeight, this._currentMeasure.left, centerTopOffset + 1, leftWidthAdjusted, targetCenterHeight - 2);\r\n // Center\r\n this._drawImage(\r\n context,\r\n sx + this._sliceLeft,\r\n sy + this._sliceTop,\r\n centerWidth,\r\n centerHeight,\r\n centerLeftOffset + 1,\r\n centerTopOffset + 1,\r\n targetCenterWidth - 2,\r\n targetCenterHeight - 2\r\n );\r\n //Right\r\n this._drawImage(\r\n context,\r\n sx + this._sliceRight,\r\n sy + this._sliceTop,\r\n rightWidth,\r\n centerHeight,\r\n rightOffset,\r\n centerTopOffset + 1,\r\n rightWidthAdjusted,\r\n targetCenterHeight - 2\r\n );\r\n //Bottom Left\r\n this._drawImage(context, sx, sy + this._sliceBottom, leftWidth, bottomHeight, this._currentMeasure.left, bottomOffset, leftWidthAdjusted, bottomHeightAdjusted);\r\n //Bottom\r\n this._drawImage(\r\n context,\r\n sx + this.sliceLeft,\r\n sy + this._sliceBottom,\r\n centerWidth,\r\n bottomHeight,\r\n centerLeftOffset + 1,\r\n bottomOffset,\r\n targetCenterWidth - 2,\r\n bottomHeightAdjusted\r\n );\r\n //Bottom Right\r\n this._drawImage(context, sx + this._sliceRight, sy + this._sliceBottom, rightWidth, bottomHeight, rightOffset, bottomOffset, rightWidthAdjusted, bottomHeightAdjusted);\r\n }\r\n\r\n public override dispose() {\r\n super.dispose();\r\n this.onImageLoadedObservable.clear();\r\n this.onSVGAttributesComputedObservable.clear();\r\n this._removeCacheUsage(this._source);\r\n }\r\n\r\n // Static\r\n /** STRETCH_NONE */\r\n public static readonly STRETCH_NONE = 0;\r\n /** STRETCH_FILL */\r\n public static readonly STRETCH_FILL = 1;\r\n /** STRETCH_UNIFORM */\r\n public static readonly STRETCH_UNIFORM = 2;\r\n /** STRETCH_EXTEND */\r\n public static readonly STRETCH_EXTEND = 3;\r\n /** NINE_PATCH */\r\n public static readonly STRETCH_NINE_PATCH = 4;\r\n}\r\nRegisterClass(\"BABYLON.GUI.Image\", Image);\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/gui",
3
- "version": "7.6.2",
3
+ "version": "7.7.1",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "postcompile": "build-tools -c add-js-to-es6"
19
19
  },
20
20
  "devDependencies": {
21
- "@babylonjs/core": "^7.6.2",
21
+ "@babylonjs/core": "^7.7.1",
22
22
  "@dev/build-tools": "^1.0.0",
23
23
  "@lts/gui": "1.0.0"
24
24
  },