Permalink
Browse files

Resizable: Update aspectRatio to use calculated aspectRatio in case o…

…f: containment - parent; aspectRatio - true. Fixes #8158 - Resizable: aspectRatio: true isn't handled properly.

(cherry picked from commit 3e8ec7e)
  • Loading branch information...
1 parent 5c2eea3 commit fea7862ff3c5c3fb65a79fbc32a5af19e1829182 @gromo gromo committed with scottgonzalez Feb 22, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 ui/jquery.ui.resizable.js
@@ -691,13 +691,13 @@ $.ui.plugin.add("resizable", "containment", {
if (cp.left < (self._helper ? co.left : 0)) {
self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
- if (pRatio) self.size.height = self.size.width / o.aspectRatio;
+ if (pRatio) self.size.height = self.size.width / self.aspectRatio;
self.position.left = o.helper ? co.left : 0;
}
if (cp.top < (self._helper ? co.top : 0)) {
self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
- if (pRatio) self.size.width = self.size.height * o.aspectRatio;
+ if (pRatio) self.size.width = self.size.height * self.aspectRatio;
self.position.top = self._helper ? co.top : 0;
}

0 comments on commit fea7862

Please sign in to comment.