diff --git a/src/index.ts b/src/index.ts index ed302bd..5068c8b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -81,6 +81,13 @@ var updateCanvasSize = () => { let ctx = canvas.getContext('2d'); ctx.fillStyle = '#000'; ctx.fillRect(0, 0, width, height) + + let text = `${res.w} x ${res.h}`; + ctx.fillStyle = '#666'; + ctx.font = 'bold 48px sans-serif'; + ctx.textAlign = 'center'; + ctx.textBaseline = 'middle'; + ctx.fillText(text, canvas.width / 2, canvas.height / 2); } var checkImageSize = () => { @@ -297,10 +304,6 @@ modelSelect.addEventListener("sl-change", event => { ctx.fillRect(0, 0, width, height); ctx.drawImage(currImage, 0, 0); } - else { - ctx.fillStyle = "#000"; - ctx.fillRect(0, 0, width, height); - } imageUploader.disabled = false; binFileInfoAlert.hide(); plausible.trackEvent("modelSelected", { props: { resolution: `${width}x${height}`, device: val, sid: sid } });