Fixed flippable scaling problem.
This commit is contained in:
Vendored
+16
-8
@@ -5504,6 +5504,7 @@
|
||||
x: x,
|
||||
y: y,
|
||||
onComplete: (e) => {
|
||||
console.log('onComplete', e);
|
||||
if (this.flipped) {
|
||||
this.hide(this.front);
|
||||
// this.hide(this.infoBtn)
|
||||
@@ -5517,17 +5518,24 @@
|
||||
//uo: check for special case that the front image must be adapted to the back size
|
||||
let frontImage = this.front.querySelector('img');
|
||||
if (frontImage) {
|
||||
let scaleX = this.flipped ? w / this.scatterStartWidth : this.scatterStartWidth / w;
|
||||
let scaleY = this.flipped ? h / this.scatterStartHeight : this.scatterStartHeight / h;
|
||||
let ratio = this.scatterStartWidth / this.scatterStartHeight;
|
||||
// Assumes that startWidth and startHeight are encoded in px
|
||||
let sh = parseInt(this.startHeight);
|
||||
let sw = parseInt(this.startWidth);
|
||||
if (this.flipped) {
|
||||
let scaleY = h / sh;
|
||||
let scaleX = w / sw;
|
||||
TweenLite.to(frontImage, duration, {
|
||||
ease: Power1.easeOut,
|
||||
scaleY: scaleY * targetScale * ratio,
|
||||
scaleX: scaleX * targetScale,
|
||||
onComplete: (e) => {
|
||||
TweenLite.set(frontImage, { scale: 1.0 });
|
||||
}
|
||||
transformOrigin: '0% 0%',
|
||||
scaleY,
|
||||
scaleX
|
||||
});
|
||||
} else {
|
||||
TweenLite.to(frontImage, duration, {
|
||||
ease: Power1.easeOut,
|
||||
transformOrigin: '0% 0%',
|
||||
scaleY: 1.0,
|
||||
scaleX: 1.0
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+16
-8
@@ -8745,6 +8745,7 @@
|
||||
x: x,
|
||||
y: y,
|
||||
onComplete: (e) => {
|
||||
console.log('onComplete', e);
|
||||
if (this.flipped) {
|
||||
this.hide(this.front);
|
||||
// this.hide(this.infoBtn)
|
||||
@@ -8758,17 +8759,24 @@
|
||||
//uo: check for special case that the front image must be adapted to the back size
|
||||
let frontImage = this.front.querySelector('img');
|
||||
if (frontImage) {
|
||||
let scaleX = this.flipped ? w / this.scatterStartWidth : this.scatterStartWidth / w;
|
||||
let scaleY = this.flipped ? h / this.scatterStartHeight : this.scatterStartHeight / h;
|
||||
let ratio = this.scatterStartWidth / this.scatterStartHeight;
|
||||
// Assumes that startWidth and startHeight are encoded in px
|
||||
let sh = parseInt(this.startHeight);
|
||||
let sw = parseInt(this.startWidth);
|
||||
if (this.flipped) {
|
||||
let scaleY = h / sh;
|
||||
let scaleX = w / sw;
|
||||
TweenLite.to(frontImage, duration, {
|
||||
ease: Power1.easeOut,
|
||||
scaleY: scaleY * targetScale * ratio,
|
||||
scaleX: scaleX * targetScale,
|
||||
onComplete: (e) => {
|
||||
TweenLite.set(frontImage, { scale: 1.0 });
|
||||
}
|
||||
transformOrigin: '0% 0%',
|
||||
scaleY,
|
||||
scaleX
|
||||
});
|
||||
} else {
|
||||
TweenLite.to(frontImage, duration, {
|
||||
ease: Power1.easeOut,
|
||||
transformOrigin: '0% 0%',
|
||||
scaleY: 1.0,
|
||||
scaleX: 1.0
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user