mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
Fixed: Position.x not working on Scaled overlay
This commit is contained in:
commit
fd9b701272
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user