From e6e1999f96adbe0f4b041d265837e00bde9283ab Mon Sep 17 00:00:00 2001 From: malern <701073+malern@users.noreply.github.com> Date: Fri, 19 May 2023 20:04:36 +0100 Subject: [PATCH] Render UI at a higher resolution when viewing with a higher pixel ratio --- web/scripts/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/scripts/app.js b/web/scripts/app.js index 97b7c8d3..514ca395 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -921,8 +921,9 @@ export class ComfyApp { this.graph.start(); function resizeCanvas() { - canvasEl.width = canvasEl.offsetWidth; - canvasEl.height = canvasEl.offsetHeight; + canvasEl.width = canvasEl.offsetWidth * window.devicePixelRatio; + canvasEl.height = canvasEl.offsetHeight * window.devicePixelRatio; + canvasEl.getContext("2d").scale(window.devicePixelRatio, window.devicePixelRatio); canvas.draw(true, true); }