mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Resizable: Update aspectRatio to use calculated aspectRatio in case of: containment - parent; aspectRatio - true. Fixes #8158 - Resizable: aspectRatio: true isn't handled properly.
This commit is contained in:
parent
f65d6b92cc
commit
3e8ec7eb6b
4
ui/jquery.ui.resizable.js
vendored
4
ui/jquery.ui.resizable.js
vendored
@ -688,13 +688,13 @@ $.ui.plugin.add("resizable", "containment", {
|
|||||||
|
|
||||||
if (cp.left < (self._helper ? co.left : 0)) {
|
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));
|
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;
|
self.position.left = o.helper ? co.left : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cp.top < (self._helper ? co.top : 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);
|
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;
|
self.position.top = self._helper ? co.top : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user