fix: enable resize/rotate controls on single-click object selection

In setMode('select'), explicitly set hasControls, hasBorders, and evented
on all objects. In drawing modes, disable selectable/evented to prevent
accidental interaction. Fixes controls only appearing on multi-select drag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Adriano
2026-02-08 10:45:56 +01:00
parent f665bffb7a
commit f2df6be060
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -526,12 +526,19 @@ function annotationEditor() {
this.canvas.defaultCursor = 'default'; this.canvas.defaultCursor = 'default';
this.canvas.forEachObject(function (o) { this.canvas.forEachObject(function (o) {
o.selectable = true; o.selectable = true;
o.evented = true;
o.hasControls = true;
o.hasBorders = true;
}); });
} else { } else {
// marker, arrow, rect // marker, arrow, rect — disable object interaction during drawing
this.canvas.selection = false; this.canvas.selection = false;
this.canvas.defaultCursor = 'crosshair'; this.canvas.defaultCursor = 'crosshair';
this.canvas.discardActiveObject(); this.canvas.discardActiveObject();
this.canvas.forEachObject(function (o) {
o.selectable = false;
o.evented = false;
});
} }
this.canvas.renderAll(); this.canvas.renderAll();
+1 -1
View File
@@ -353,7 +353,7 @@
<script> <script>
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js'; pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js';
</script> </script>
<script src="{{ url_for('static', filename='js/annotation-editor.js') }}?v=9"></script> <script src="{{ url_for('static', filename='js/annotation-editor.js') }}?v=10"></script>
<script> <script>
function taskDrawing() { function taskDrawing() {
const taskData = window.__taskData || {}; const taskData = window.__taskData || {};