|
@@ -645,6 +645,10 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
* Gets or sets a boolean defining if alpha is stored as premultiplied
|
|
* Gets or sets a boolean defining if alpha is stored as premultiplied
|
|
*/
|
|
*/
|
|
_this.premulAlpha = false;
|
|
_this.premulAlpha = false;
|
|
|
|
+ /**
|
|
|
|
+ * Gets or sets a boolean indicating that the canvas must be reverted on Y when updating the texture
|
|
|
|
+ */
|
|
|
|
+ _this.applyYInversionOnUpdate = true;
|
|
_this._useInvalidateRectOptimization = true;
|
|
_this._useInvalidateRectOptimization = true;
|
|
// Invalidated rectangle which is the combination of all invalidated controls after they have been rotated into absolute position
|
|
// Invalidated rectangle which is the combination of all invalidated controls after they have been rotated into absolute position
|
|
_this._invalidatedRectangle = null;
|
|
_this._invalidatedRectangle = null;
|
|
@@ -1190,7 +1194,7 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
}
|
|
}
|
|
this._isDirty = false;
|
|
this._isDirty = false;
|
|
this._render();
|
|
this._render();
|
|
- this.update(true, this.premulAlpha);
|
|
|
|
|
|
+ this.update(this.applyYInversionOnUpdate, this.premulAlpha);
|
|
};
|
|
};
|
|
AdvancedDynamicTexture.prototype._render = function () {
|
|
AdvancedDynamicTexture.prototype._render = function () {
|
|
var textureSize = this.getSize();
|
|
var textureSize = this.getSize();
|
|
@@ -1376,7 +1380,7 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
var uv = pi.pickInfo.getTextureCoordinates();
|
|
var uv = pi.pickInfo.getTextureCoordinates();
|
|
if (uv) {
|
|
if (uv) {
|
|
var size = _this.getSize();
|
|
var size = _this.getSize();
|
|
- _this._doPicking(uv.x * size.width, (1.0 - uv.y) * size.height, pi, pi.type, pointerId, pi.event.button);
|
|
|
|
|
|
+ _this._doPicking(uv.x * size.width, (_this.applyYInversionOnUpdate ? (1.0 - uv.y) : uv.y) * size.height, pi, pi.type, pointerId, pi.event.button);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (pi.type === babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["PointerEventTypes"].POINTERUP) {
|
|
else if (pi.type === babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["PointerEventTypes"].POINTERUP) {
|