From 59bc83c28239f7dabaff561bfccb52eac6c54b23 Mon Sep 17 00:00:00 2001 From: Igor Zinken Date: Mon, 31 Jan 2022 10:01:12 +0100 Subject: [PATCH] Fixed issue where cropping certain selections could lead to a crop larger than the original document size --- src/components/application-menu/application-menu.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/application-menu/application-menu.vue b/src/components/application-menu/application-menu.vue index 500d500..46679c6 100644 --- a/src/components/application-menu/application-menu.vue +++ b/src/components/application-menu/application-menu.vue @@ -575,8 +575,8 @@ export default { const commit = async () => { await store.commit( "cropActiveDocumentContent", { left, top }); store.commit( "setActiveDocumentSize", { - width : Math.min( currentSize.width, width ), - height : Math.min( currentSize.height, height ) + width : Math.min( currentSize.width - left, width ), + height : Math.min( currentSize.height - top, height ) }); getCanvasInstance()?.interactionPane.setSelection( null, false ); };