From da95ff210d93da512809d9f917f3e62264d01fe6 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Fri, 13 Sep 2019 11:57:41 +0000 Subject: [PATCH] [FIX] web_editor: allow better usability to crop all image zones Before this commit, when rotating an image so that it overflew the cropper canvas, it was not possible to unzoom on some part of the image. Now, with the new set of options used by this commit, the cropping zone and the image can be moved independently allowing to do everything. Part of https://github.com/odoo/odoo/pull/36880 task-2059480 --- .../web_editor/static/src/js/wysiwyg/widgets/crop_dialog.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/crop_dialog.js b/addons/web_editor/static/src/js/wysiwyg/widgets/crop_dialog.js index 19623d05f5e..3c8e653f366 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/crop_dialog.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/crop_dialog.js @@ -116,8 +116,9 @@ var CropImageDialog = Dialog.extend({ } } this.$cropperImage.cropper({ - viewMode: 1, - autoCropArea: 1, + viewMode: 2, + dragMode: 'move', + autoCropArea: 1.0, aspectRatio: ratio, data: _.pick(data, 'x', 'y', 'width', 'height', 'rotate', 'scaleX', 'scaleY') });