Skip to content

Commit 3e8ec7e

Browse files
gromoscottgonzalez
gromo
authored andcommitted
Resizable: Update aspectRatio to use calculated aspectRatio in case of: containment - parent; aspectRatio - true. Fixes #8158 - Resizable: aspectRatio: true isn't handled properly.
1 parent f65d6b9 commit 3e8ec7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/jquery.ui.resizable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,13 +688,13 @@ $.ui.plugin.add("resizable", "containment", {
688688

689689
if (cp.left < (self._helper ? co.left : 0)) {
690690
self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
691-
if (pRatio) self.size.height = self.size.width / o.aspectRatio;
691+
if (pRatio) self.size.height = self.size.width / self.aspectRatio;
692692
self.position.left = o.helper ? co.left : 0;
693693
}
694694

695695
if (cp.top < (self._helper ? co.top : 0)) {
696696
self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
697-
if (pRatio) self.size.width = self.size.height * o.aspectRatio;
697+
if (pRatio) self.size.width = self.size.height * self.aspectRatio;
698698
self.position.top = self._helper ? co.top : 0;
699699
}
700700

0 commit comments

Comments
 (0)