From 5667da9ad2f5ae655265d5c42be831457d0f76cb Mon Sep 17 00:00:00 2001 From: Richard Schreiber Date: Tue, 19 Dec 2023 06:23:09 +0100 Subject: [PATCH] PDF-Editor: fix controls when resizing multiple objects (#3764) Co-authored-by: Mira --- src/pretix/static/pretixcontrol/js/ui/editor.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pretix/static/pretixcontrol/js/ui/editor.js b/src/pretix/static/pretixcontrol/js/ui/editor.js index cfcde0489..d34b7c8c5 100644 --- a/src/pretix/static/pretixcontrol/js/ui/editor.js +++ b/src/pretix/static/pretixcontrol/js/ui/editor.js @@ -466,7 +466,15 @@ var editor = { $("#toolbox-position-x").val(editor._px2mm(o.left).toFixed(2)); $("#toolbox-position-y").val(editor._px2mm(bottom).toFixed(2)); - if (o.type === "barcodearea") { + if (o.type === 'activeSelection') { + // limit controls to the ones which are common to every element in selection + o.forEachControl(function(control, key) { + o.setControlVisible(key, o.getObjects().every(function(obj) { + // special case „text“ in group does not support any controls + return obj.type !== "text" && obj.type !== "textarea" && obj.isControlVisible(key) + })); + }); + } else if (o.type === "barcodearea") { $("#toolbox-squaresize").val(editor._px2mm(o.height * o.scaleY).toFixed(2)); $("#toolbox-qrwhitespace").prop("checked", o.nowhitespace || false); } else if (o.type === "imagearea") {