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:
@@ -526,12 +526,19 @@ function annotationEditor() {
|
||||
this.canvas.defaultCursor = 'default';
|
||||
this.canvas.forEachObject(function (o) {
|
||||
o.selectable = true;
|
||||
o.evented = true;
|
||||
o.hasControls = true;
|
||||
o.hasBorders = true;
|
||||
});
|
||||
} else {
|
||||
// marker, arrow, rect
|
||||
// marker, arrow, rect — disable object interaction during drawing
|
||||
this.canvas.selection = false;
|
||||
this.canvas.defaultCursor = 'crosshair';
|
||||
this.canvas.discardActiveObject();
|
||||
this.canvas.forEachObject(function (o) {
|
||||
o.selectable = false;
|
||||
o.evented = false;
|
||||
});
|
||||
}
|
||||
|
||||
this.canvas.renderAll();
|
||||
|
||||
@@ -353,7 +353,7 @@
|
||||
<script>
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js';
|
||||
</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>
|
||||
function taskDrawing() {
|
||||
const taskData = window.__taskData || {};
|
||||
|
||||
Reference in New Issue
Block a user