Skip to content

Commit fea7862

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.
(cherry picked from commit 3e8ec7e)
1 parent 5c2eea3 commit fea7862

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/jquery.ui.resizable.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -691,13 +691,13 @@ $.ui.plugin.add("resizable", "containment", {
691691

692692
if (cp.left < (self._helper ? co.left : 0)) {
693693
self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
694-
if (pRatio) self.size.height = self.size.width / o.aspectRatio;
694+
if (pRatio) self.size.height = self.size.width / self.aspectRatio;
695695
self.position.left = o.helper ? co.left : 0;
696696
}
697697

698698
if (cp.top < (self._helper ? co.top : 0)) {
699699
self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
700-
if (pRatio) self.size.width = self.size.height * o.aspectRatio;
700+
if (pRatio) self.size.width = self.size.height * self.aspectRatio;
701701
self.position.top = self._helper ? co.top : 0;
702702
}
703703

0 commit comments

Comments
 (0)