word/edit: read fractional crop coordinates
[sheet.git] / word / editor.js
index 461bab0aa15a2b13ec83d57c7f58c8a43bedb4a7..4eb2382434c238792e0cc718c926737f757dcaf7 100644 (file)
@@ -126,7 +126,7 @@ document.addEventListener('DOMContentLoaded', () => {
                        const canvas = [thumbpreview.clientWidth, thumbpreview.clientHeight];
                        const border = [canvas[0], canvas[0] * imgpreview.height / imgpreview.width];
                        const minscale = Math.max(1, canvas[1] / border[1]); // 100% or fit width
-                       let crop = cropinput.value.split(/[^0-9]/).map(pos => pos / 1000);
+                       let crop = cropinput.value.split(/[^0-9.]/).map(pos => pos / 1000);
                        let scale = 1 / (crop[2] - crop[0]) || minscale;
                        crop.push(0); // defined y dimension
                        crop.splice(2); // end coordinates applied to zoom