Render UI at a higher resolution when viewing with a higher pixel ratio

This commit is contained in:
malern 2023-05-19 20:04:36 +01:00
parent 2998e232cb
commit e6e1999f96
1 changed files with 3 additions and 2 deletions

View File

@ -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);
}