diff options
| author | eleanor-park <eleanor_park@brown.edu> | 2024-12-30 23:35:24 -0500 |
|---|---|---|
| committer | eleanor-park <eleanor_park@brown.edu> | 2024-12-30 23:35:24 -0500 |
| commit | 0eff48b757ca81860a883d25e147b8a869e5fe00 (patch) | |
| tree | 11e8333c424bc72b08357a38d05ab668423d16d1 /src/client/views/nodes/imageEditor/ImageEditor.tsx | |
| parent | 7e5f6fdc205eae1b0ab76390644257a82bf6ebf1 (diff) | |
created image regeneration with dialogue
Diffstat (limited to 'src/client/views/nodes/imageEditor/ImageEditor.tsx')
| -rw-r--r-- | src/client/views/nodes/imageEditor/ImageEditor.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/views/nodes/imageEditor/ImageEditor.tsx b/src/client/views/nodes/imageEditor/ImageEditor.tsx index a39878924..2a8bc034d 100644 --- a/src/client/views/nodes/imageEditor/ImageEditor.tsx +++ b/src/client/views/nodes/imageEditor/ImageEditor.tsx @@ -411,7 +411,7 @@ const ImageEditor = ({ imageEditorOpen, imageEditorSource, imageRootDoc, addDoc let finalImgURL: string = url; // crop the image for these brush modes to remove excess blank space around the image contents if (currCutType == CutMode.IN || currCutType == CutMode.DRAW_IN) { - const croppedData = cropImage(image, minX, maxX, minY, maxY); + const croppedData = cropImage(image, Math.max(minX, 0), Math.min(maxX, image.width), Math.max(minY, 0), Math.min(maxY, image.height)); finalImg = croppedData; finalImgURL = croppedData.src; } |
