|
|
@@ -95,9 +95,14 @@ const rectangle = registerShapeUtils<RectangleShape>({
|
|
95
|
95
|
|
|
96
|
96
|
transform(shape, bounds, { initialShape, transformOrigin, scaleX, scaleY }) {
|
|
97
|
97
|
if (shape.rotation === 0) {
|
|
98
|
|
- shape.point = [bounds.minX, bounds.minY]
|
|
99
|
98
|
shape.size = [bounds.width, bounds.height]
|
|
|
99
|
+ shape.point = [bounds.minX, bounds.minY]
|
|
100
|
100
|
} else {
|
|
|
101
|
+ shape.size = vec.mul(
|
|
|
102
|
+ initialShape.size,
|
|
|
103
|
+ Math.min(Math.abs(scaleX), Math.abs(scaleY))
|
|
|
104
|
+ )
|
|
|
105
|
+
|
|
101
|
106
|
shape.point = [
|
|
102
|
107
|
bounds.minX +
|
|
103
|
108
|
(bounds.width - shape.size[0]) *
|
|
|
@@ -107,11 +112,6 @@ const rectangle = registerShapeUtils<RectangleShape>({
|
|
107
|
112
|
(scaleY < 0 ? 1 - transformOrigin[1] : transformOrigin[1]),
|
|
108
|
113
|
]
|
|
109
|
114
|
|
|
110
|
|
- shape.size = vec.mul(
|
|
111
|
|
- initialShape.size,
|
|
112
|
|
- Math.min(Math.abs(scaleX), Math.abs(scaleY))
|
|
113
|
|
- )
|
|
114
|
|
-
|
|
115
|
115
|
shape.rotation =
|
|
116
|
116
|
(scaleX < 0 && scaleY >= 0) || (scaleY < 0 && scaleX >= 0)
|
|
117
|
117
|
? -initialShape.rotation
|