|
@@ -144,7 +144,7 @@ export function resizeElements(
|
144
|
144
|
width,
|
145
|
145
|
height,
|
146
|
146
|
...adjustXYWithRotation("nw", element, deltaX, dY, angle),
|
147
|
|
- ...(isLinearElement(element) && width >= 0 && height >= 0
|
|
147
|
+ ...(isLinearElement(element) && width !== 0 && height !== 0
|
148
|
148
|
? {
|
149
|
149
|
points: rescalePoints(
|
150
|
150
|
0,
|
|
@@ -176,7 +176,7 @@ export function resizeElements(
|
176
|
176
|
width,
|
177
|
177
|
height,
|
178
|
178
|
...adjustXYWithRotation("ne", element, deltaX, dY, angle),
|
179
|
|
- ...(isLinearElement(element) && width >= 0 && height >= 0
|
|
179
|
+ ...(isLinearElement(element) && width !== 0 && height !== 0
|
180
|
180
|
? {
|
181
|
181
|
points: rescalePoints(
|
182
|
182
|
0,
|
|
@@ -208,7 +208,7 @@ export function resizeElements(
|
208
|
208
|
width,
|
209
|
209
|
height,
|
210
|
210
|
...adjustXYWithRotation("sw", element, deltaX, dY, angle),
|
211
|
|
- ...(isLinearElement(element) && width >= 0 && height >= 0
|
|
211
|
+ ...(isLinearElement(element) && width !== 0 && height !== 0
|
212
|
212
|
? {
|
213
|
213
|
points: rescalePoints(
|
214
|
214
|
0,
|
|
@@ -240,7 +240,7 @@ export function resizeElements(
|
240
|
240
|
width,
|
241
|
241
|
height,
|
242
|
242
|
...adjustXYWithRotation("se", element, deltaX, dY, angle),
|
243
|
|
- ...(isLinearElement(element) && width >= 0 && height >= 0
|
|
243
|
+ ...(isLinearElement(element) && width !== 0 && height !== 0
|
244
|
244
|
? {
|
245
|
245
|
points: rescalePoints(
|
246
|
246
|
0,
|
|
@@ -255,12 +255,7 @@ export function resizeElements(
|
255
|
255
|
case "n": {
|
256
|
256
|
const height = element.height - deltaY;
|
257
|
257
|
|
258
|
|
- if (isLinearElement(element)) {
|
259
|
|
- if (element.points.length > 2 && height <= 0) {
|
260
|
|
- // Someday we should implement logic to flip the shape.
|
261
|
|
- // But for now, just stop.
|
262
|
|
- break;
|
263
|
|
- }
|
|
258
|
+ if (isLinearElement(element) && height !== 0) {
|
264
|
259
|
mutateElement(element, {
|
265
|
260
|
height,
|
266
|
261
|
...adjustXYWithRotation("n", element, 0, deltaY, angle),
|
|
@@ -278,13 +273,7 @@ export function resizeElements(
|
278
|
273
|
case "w": {
|
279
|
274
|
const width = element.width - deltaX;
|
280
|
275
|
|
281
|
|
- if (isLinearElement(element)) {
|
282
|
|
- if (element.points.length > 2 && width <= 0) {
|
283
|
|
- // Someday we should implement logic to flip the shape.
|
284
|
|
- // But for now, just stop.
|
285
|
|
- break;
|
286
|
|
- }
|
287
|
|
-
|
|
276
|
+ if (isLinearElement(element) && width !== 0) {
|
288
|
277
|
mutateElement(element, {
|
289
|
278
|
width,
|
290
|
279
|
...adjustXYWithRotation("w", element, deltaX, 0, angle),
|
|
@@ -301,12 +290,7 @@ export function resizeElements(
|
301
|
290
|
case "s": {
|
302
|
291
|
const height = element.height + deltaY;
|
303
|
292
|
|
304
|
|
- if (isLinearElement(element)) {
|
305
|
|
- if (element.points.length > 2 && height <= 0) {
|
306
|
|
- // Someday we should implement logic to flip the shape.
|
307
|
|
- // But for now, just stop.
|
308
|
|
- break;
|
309
|
|
- }
|
|
293
|
+ if (isLinearElement(element) && height !== 0) {
|
310
|
294
|
mutateElement(element, {
|
311
|
295
|
height,
|
312
|
296
|
...adjustXYWithRotation("s", element, 0, deltaY, angle),
|
|
@@ -323,12 +307,7 @@ export function resizeElements(
|
323
|
307
|
case "e": {
|
324
|
308
|
const width = element.width + deltaX;
|
325
|
309
|
|
326
|
|
- if (isLinearElement(element)) {
|
327
|
|
- if (element.points.length > 2 && width <= 0) {
|
328
|
|
- // Someday we should implement logic to flip the shape.
|
329
|
|
- // But for now, just stop.
|
330
|
|
- break;
|
331
|
|
- }
|
|
310
|
+ if (isLinearElement(element) && width !== 0) {
|
332
|
311
|
mutateElement(element, {
|
333
|
312
|
width,
|
334
|
313
|
...adjustXYWithRotation("e", element, deltaX, 0, angle),
|