@@ -251,6 +251,7 @@ export default {
251
251
parentHeight: null ,
252
252
253
253
handle: null ,
254
+ realHandle: null ,
254
255
enabled: this .active ,
255
256
resizing: false ,
256
257
dragging: false ,
@@ -455,6 +456,7 @@ export default {
455
456
} else {
456
457
this .handle = handle
457
458
}
459
+ this .realHandle = handle;
458
460
459
461
this .resizeEnable = true
460
462
@@ -656,7 +658,11 @@ export default {
656
658
)
657
659
658
660
if (this .lockAspectRatio && this .resizingOnY ) {
659
- right = this .right - (this .bottom - bottom) * aspectFactor
661
+ if (this .realHandle .includes (" r" )) {
662
+ right = this .right - (this .bottom - bottom) * aspectFactor;
663
+ } else {
664
+ left = this .left - (this .bottom - bottom) * aspectFactor;
665
+ }
660
666
}
661
667
} else if (this .handle .includes (' t' )) {
662
668
top = restrictToBounds (
@@ -666,7 +672,11 @@ export default {
666
672
)
667
673
668
674
if (this .lockAspectRatio && this .resizingOnY ) {
669
- left = this .left - (this .top - top) * aspectFactor
675
+ if (this .realHandle .includes (" r" )) {
676
+ right = this .right - (this .top - top) * aspectFactor;
677
+ } else {
678
+ left = this .left - (this .top - top) * aspectFactor;
679
+ }
670
680
}
671
681
}
672
682
@@ -678,7 +688,11 @@ export default {
678
688
)
679
689
680
690
if (this .lockAspectRatio && this .resizingOnX ) {
681
- bottom = this .bottom - (this .right - right) / aspectFactor
691
+ if (this .realHandle .includes (" b" )) {
692
+ bottom = this .bottom - (this .right - right) / aspectFactor;
693
+ } else {
694
+ top = this .top - (this .right - right) / aspectFactor;
695
+ }
682
696
}
683
697
} else if (this .handle .includes (' l' )) {
684
698
left = restrictToBounds (
@@ -688,7 +702,11 @@ export default {
688
702
)
689
703
690
704
if (this .lockAspectRatio && this .resizingOnX ) {
691
- top = this .top - (this .left - left) / aspectFactor
705
+ if (this .realHandle .includes (" b" )) {
706
+ bottom = this .bottom - (this .left - left) / aspectFactor;
707
+ } else {
708
+ top = this .top - (this .left - left) / aspectFactor;
709
+ }
692
710
}
693
711
}
694
712
0 commit comments