diff --git a/public/app.mjs b/public/app.mjs index 165001a..7d3b891 100644 --- a/public/app.mjs +++ b/public/app.mjs @@ -2107,6 +2107,10 @@ function open_bin_editor(bin) { bin_editor_bin_id = bin.id; document.getElementById('bin-editor-name').value = bin.name; + // Show dialog first so the canvas has correct layout dimensions before + // load_image reads parentElement.clientWidth to size itself. + dlg.showModal(); + const canvas = document.getElementById('bin-editor-canvas'); bin_editor_instance = new Grid_Setup(canvas); bin_editor_instance.set_rows(1); @@ -2116,8 +2120,6 @@ function open_bin_editor(bin) { bin_editor_instance.set_corners(bin.corners); } }); - - dlg.showModal(); } // ---------------------------------------------------------------------------