Fixed: Position.x not working on Scaled overlay

This commit is contained in:
Richard Benjamin Allen 2024-07-09 10:37:51 +01:00
commit fd9b701272

View File

@ -287,12 +287,15 @@
var transformProp = $.getCssPropertyWithVendorPrefix( var transformProp = $.getCssPropertyWithVendorPrefix(
'transform'); 'transform');
if (transformOriginProp && transformProp) { if (transformOriginProp && transformProp) {
if (rotate) { if (rotate && !viewport.flipped) {
style[transformOriginProp] = this._getTransformOrigin(); style[transformOriginProp] = this._getTransformOrigin();
style[transformProp] = "rotate(" + rotate + "deg)" + scale; style[transformProp] = "rotate(" + rotate + "deg)";
} else if (!rotate && viewport.flipped) { } else if (!rotate && viewport.flipped) {
style[transformOriginProp] = this._getTransformOrigin(); style[transformOriginProp] = this._getTransformOrigin();
style[transformProp] = "scaleX(-1)"; style[transformProp] = scale;
} else if (rotate && viewport.flipped){
style[transformOriginProp] = this._getTransformOrigin();
style[transformProp] = "rotate(" + rotate + "deg)" + scale;
} else { } else {
style[transformOriginProp] = ""; style[transformOriginProp] = "";
style[transformProp] = ""; style[transformProp] = "";
@ -318,9 +321,6 @@
var rect = new $.Rect(position.x, position.y, size.x, size.y); var rect = new $.Rect(position.x, position.y, size.x, size.y);
var boundingBox = this._getBoundingBox(rect, viewport.getRotation(true)); var boundingBox = this._getBoundingBox(rect, viewport.getRotation(true));
position = boundingBox.getTopLeft(); position = boundingBox.getTopLeft();
if (viewport.flipped){
position.x = (viewport.getContainerSize().x - position.x);
}
size = boundingBox.getSize(); size = boundingBox.getSize();
} else { } else {
rotate = viewport.getRotation(true); rotate = viewport.getRotation(true);