File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed
src/components/EditorCanvas Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -280,23 +280,22 @@ export default function Canvas() {
280
280
281
281
if ( ! e . isPrimary ) return ;
282
282
283
-
284
283
if ( panning . isPanning ) {
285
284
setTransform ( ( prev ) => ( {
286
285
...prev ,
287
286
pan : {
288
287
x :
289
- panning . panStart . x +
290
- ( panning . cursorStart . x - pointer . spaces . screen . x ) / transform . zoom ,
288
+ panning . panStart . x +
289
+ ( panning . cursorStart . x - pointer . spaces . screen . x ) / transform . zoom ,
291
290
y :
292
- panning . panStart . y +
293
- ( panning . cursorStart . y - pointer . spaces . screen . y ) / transform . zoom ,
291
+ panning . panStart . y +
292
+ ( panning . cursorStart . y - pointer . spaces . screen . y ) / transform . zoom ,
294
293
} ,
295
294
} ) ) ;
296
295
return ;
297
296
}
298
297
299
- if ( layout . readOnly ) return ;
298
+ if ( layout . readOnly ) return ;
300
299
301
300
if ( linking ) {
302
301
setLinkingLine ( {
@@ -377,7 +376,21 @@ export default function Canvas() {
377
376
break ;
378
377
}
379
378
380
- if ( newDims . width < minAreaSize || newDims . height < minAreaSize ) return ;
379
+ if ( newDims . width <= minAreaSize ) {
380
+ newDims . width = minAreaSize ;
381
+ if ( areaResize . dir === "tl" || areaResize . dir === "bl" ) {
382
+ newDims . x =
383
+ areaInitDimensions . x + areaInitDimensions . width - minAreaSize ;
384
+ }
385
+ }
386
+
387
+ if ( newDims . height <= minAreaSize ) {
388
+ newDims . height = minAreaSize ;
389
+ if ( areaResize . dir === "tl" || areaResize . dir === "tr" ) {
390
+ newDims . y =
391
+ areaInitDimensions . y + areaInitDimensions . height - minAreaSize ;
392
+ }
393
+ }
381
394
382
395
updateArea ( areaResize . id , { ...newDims } ) ;
383
396
return ;
You can’t perform that action at this time.
0 commit comments