File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -842,12 +842,20 @@ if ((Object.values(SHAPE_TYPE).includes(activeTool) || activeTool.startsWith('br
842842 }
843843
844844 // For rectangle/line: set start/end
845- if ( sh . type === SHAPE_TYPE . RECTANGLE || sh . type === SHAPE_TYPE . LINE ) {
845+ if (
846+ sh . type === SHAPE_TYPE . RECTANGLE ||
847+ sh . type === SHAPE_TYPE . LINE ||
848+ sh . type === SHAPE_TYPE . IMAGE
849+ ) {
846850 // Normalize start/end so start is top-left and end is bottom-right for storage simplicity
847851 const newStart = { x : Math . min ( minX , maxX ) , y : Math . min ( minY , maxY ) } ;
848852 const newEnd = { x : Math . max ( minX , maxX ) , y : Math . max ( minY , maxY ) } ;
849853 sh . start = newStart ;
850854 sh . end = newEnd ;
855+ if ( sh . type === SHAPE_TYPE . IMAGE ) {
856+ sh . width = newEnd . x - newStart . x ;
857+ sh . height = newEnd . y - newStart . y ;
858+ }
851859 }
852860
853861 // For pen: scale all points from origBBox to new bbox
You can’t perform that action at this time.
0 commit comments