Commit 0bb1b20a authored by Thomas Marrinan's avatar Thomas Marrinan

Resize with corner drag while holding SHIFT gives free-resize (does not constrain aspect)


Former-commit-id: c0309b33fef361e4cd26c726dc2b060dd78e3dff
parent 49bb8651
......@@ -133,15 +133,24 @@ interaction.prototype.resizeSelectedItem = function(pointerX, pointerY) {
if(this.selectedResizeItem === null) return null;
var iWidth = pointerX - this.selectedResizeItem.left + this.selectOffsetX;
var iHeight = iWidth / this.selectedResizeItem.aspect;
// var iHeight = pointerY - this.selectedResizeItem.top + this.selectOffsetY; // correct - but does not preserve aspect ratio
if(iWidth < 40){
iWidth = 40;
iHeight = iWidth / this.selectedResizeItem.aspect;
var iHeight = 1;
if(this.SHIFT === true){
iHeight = pointerY - this.selectedResizeItem.top + this.selectOffsetY;
if(iWidth < 40) iWidth = 40;
if(iHeight < 40) iHeight = 40;
this.selectedResizeItem.aspect = iWidth/iHeight;
}
if(iHeight < 40){
iHeight = 40;
iWidth = iHeight * this.selectedResizeItem.aspect;
else{
iHeight = iWidth / this.selectedResizeItem.aspect;
if(iWidth < 40){
iWidth = 40;
iHeight = iWidth / this.selectedResizeItem.aspect;
}
if(iHeight < 40){
iHeight = 40;
iWidth = iHeight * this.selectedResizeItem.aspect;
}
}
this.selectedResizeItem.width = iWidth;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment