From 70e1772840f8aa6bdc82c7f3db9888e878056edd Mon Sep 17 00:00:00 2001 From: christian-byrne Date: Mon, 24 Jun 2024 11:18:00 -0700 Subject: [PATCH] Litegraph centerOnNode DPI fix --- web/lib/litegraph.core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/lib/litegraph.core.js b/web/lib/litegraph.core.js index 427a62b59..4428aa0e8 100644 --- a/web/lib/litegraph.core.js +++ b/web/lib/litegraph.core.js @@ -7559,11 +7559,11 @@ LGraphNode.prototype.executeAction = function(action) this.ds.offset[0] = -node.pos[0] - node.size[0] * 0.5 + - (this.canvas.width * 0.5) / this.ds.scale; + (this.canvas.width * 0.5) / (this.ds.scale * window.devicePixelRatio); this.ds.offset[1] = -node.pos[1] - node.size[1] * 0.5 + - (this.canvas.height * 0.5) / this.ds.scale; + (this.canvas.height * 0.5) / (this.ds.scale * window.devicePixelRatio); this.setDirty(true, true); };