fixed bug when resizing scaled pads
This commit is contained in:
parent
cf48fce4ff
commit
31186d99a6
8
dist/iwmlib.js
vendored
8
dist/iwmlib.js
vendored
@ -4149,12 +4149,12 @@
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let event = new CustomEvent('resizeStarted');
|
let event = new CustomEvent('resizeStarted');
|
||||||
|
|
||||||
let oldPostition = {x: this.element.offsetLeft, y: this.element.offsetTop};
|
let oldPostition = {x: this.element.getBoundingClientRect().left, y: this.element.getBoundingClientRect().top};
|
||||||
this.bringToFront();
|
this.bringToFront();
|
||||||
|
|
||||||
this.element.style.transformOrigin = "0% 0%";
|
this.element.style.transformOrigin = "0% 0%";
|
||||||
|
|
||||||
let newPostition = {x: this.element.offsetLeft, y: this.element.offsetTop};
|
let newPostition = {x: this.element.getBoundingClientRect().left, y: this.element.getBoundingClientRect().top};
|
||||||
|
|
||||||
let offset = Points.subtract(oldPostition, newPostition);
|
let offset = Points.subtract(oldPostition, newPostition);
|
||||||
|
|
||||||
@ -4207,9 +4207,9 @@
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
let event = new CustomEvent('resizeEnded');
|
let event = new CustomEvent('resizeEnded');
|
||||||
let oldPostition = {x: this.element.offsetLeft, y: this.element.offsetTop};
|
let oldPostition = {x: this.element.getBoundingClientRect().left, y: this.element.getBoundingClientRect().top};
|
||||||
this.element.style.transformOrigin = "50% 50%";
|
this.element.style.transformOrigin = "50% 50%";
|
||||||
let newPostition = {x: this.element.offsetLeft, y: this.element.offsetTop};
|
let newPostition = {x: this.element.getBoundingClientRect().left, y: this.element.getBoundingClientRect().top};
|
||||||
let offset = Points.subtract(oldPostition, newPostition);
|
let offset = Points.subtract(oldPostition, newPostition);
|
||||||
|
|
||||||
TweenLite.to(this.element, 0, { css: { left: "+=" + offset.x + "px" } });
|
TweenLite.to(this.element, 0, { css: { left: "+=" + offset.x + "px" } });
|
||||||
|
@ -1386,12 +1386,12 @@ export class DOMScatter extends AbstractScatter {
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
let event = new CustomEvent('resizeStarted')
|
let event = new CustomEvent('resizeStarted')
|
||||||
|
|
||||||
let oldPostition = {x: this.element.offsetLeft, y: this.element.offsetTop}
|
let oldPostition = {x: this.element.getBoundingClientRect().left, y: this.element.getBoundingClientRect().top};
|
||||||
this.bringToFront()
|
this.bringToFront()
|
||||||
|
|
||||||
this.element.style.transformOrigin = "0% 0%"
|
this.element.style.transformOrigin = "0% 0%"
|
||||||
|
|
||||||
let newPostition = {x: this.element.offsetLeft, y: this.element.offsetTop}
|
let newPostition = {x: this.element.getBoundingClientRect().left, y: this.element.getBoundingClientRect().top};
|
||||||
|
|
||||||
let offset = Points.subtract(oldPostition, newPostition)
|
let offset = Points.subtract(oldPostition, newPostition)
|
||||||
|
|
||||||
@ -1444,9 +1444,9 @@ export class DOMScatter extends AbstractScatter {
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
let event = new CustomEvent('resizeEnded')
|
let event = new CustomEvent('resizeEnded')
|
||||||
let oldPostition = {x: this.element.offsetLeft, y: this.element.offsetTop}
|
let oldPostition = {x: this.element.getBoundingClientRect().left, y: this.element.getBoundingClientRect().top};
|
||||||
this.element.style.transformOrigin = "50% 50%"
|
this.element.style.transformOrigin = "50% 50%"
|
||||||
let newPostition = {x: this.element.offsetLeft, y: this.element.offsetTop}
|
let newPostition = {x: this.element.getBoundingClientRect().left, y: this.element.getBoundingClientRect().top};
|
||||||
let offset = Points.subtract(oldPostition, newPostition)
|
let offset = Points.subtract(oldPostition, newPostition)
|
||||||
|
|
||||||
TweenLite.to(this.element, 0, { css: { left: "+=" + offset.x + "px" } })
|
TweenLite.to(this.element, 0, { css: { left: "+=" + offset.x + "px" } })
|
||||||
|
Loading…
Reference in New Issue
Block a user