Fixing ugly canvas. now full browser window, fixing dpi blurry issue

This commit is contained in:
Dustin Swan 2026-02-03 13:28:20 -07:00
parent 86996ed4ef
commit 58715f42bf
No known key found for this signature in database
GPG key ID: 30D46587E2100467
4 changed files with 45 additions and 11 deletions

View file

@ -25,7 +25,12 @@ let focusedInputSubmit: Value | null = null;
export function render(ui: UIValue, canvas: HTMLCanvasElement) {
const ctx = canvas.getContext('2d');
if (ctx) {
const dpr = window.devicePixelRatio || 1;
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
clickRegions = [];
textInputRegions = [];
renderUI(ui, ctx, 0, 0);