Fix Selection Marquee display is offset when DPI < 1 (#692)

Fixes https://github.com/Comfy-Org/ComfyUI_frontend/issues/2481. The
canvas scaling behavior is not consistent with DPI which is the source
of many bugs. To verify, add console log somewhere:
This commit is contained in:
bymyself
2025-03-02 23:06:15 -07:00
committed by GitHub
parent 2a12864a67
commit 83fb246119

View File

@@ -4179,7 +4179,7 @@ export class LGraphCanvas implements ConnectionColorContext {
if (eDown && eMove) {
// Do not scale the selection box
const transform = ctx.getTransform()
const ratio = window.devicePixelRatio
const ratio = Math.max(1, window.devicePixelRatio)
ctx.setTransform(ratio, 0, 0, ratio, 0, 0)
const x = eDown.safeOffsetX