diff --git a/browser_tests/tests/rerouteNode.spec.ts b/browser_tests/tests/rerouteNode.spec.ts index 5359580f2..4c7065e3f 100644 --- a/browser_tests/tests/rerouteNode.spec.ts +++ b/browser_tests/tests/rerouteNode.spec.ts @@ -48,7 +48,9 @@ test.describe('LiteGraph Native Reroute Node', () => { await expect(comfyPage.canvas).toHaveScreenshot('native_reroute.png') }) - test('Can add reroute by alt clicking on link', async ({ comfyPage }) => { + test('@2x @0.5x Can add reroute by alt clicking on link', async ({ + comfyPage + }) => { const loadCheckpointNode = ( await comfyPage.getNodeRefsByTitle('Load Checkpoint') )[0] diff --git a/browser_tests/tests/rerouteNode.spec.ts-snapshots/native-reroute-alt-click-chromium-0-5x-linux.png b/browser_tests/tests/rerouteNode.spec.ts-snapshots/native-reroute-alt-click-chromium-0-5x-linux.png new file mode 100644 index 000000000..f58efed43 Binary files /dev/null and b/browser_tests/tests/rerouteNode.spec.ts-snapshots/native-reroute-alt-click-chromium-0-5x-linux.png differ diff --git a/browser_tests/tests/rerouteNode.spec.ts-snapshots/native-reroute-alt-click-chromium-2x-linux.png b/browser_tests/tests/rerouteNode.spec.ts-snapshots/native-reroute-alt-click-chromium-2x-linux.png new file mode 100644 index 000000000..d29787e49 Binary files /dev/null and b/browser_tests/tests/rerouteNode.spec.ts-snapshots/native-reroute-alt-click-chromium-2x-linux.png differ diff --git a/browser_tests/tests/widget.spec.ts-snapshots/animated-image-preview-saved-webp-chromium-linux.png b/browser_tests/tests/widget.spec.ts-snapshots/animated-image-preview-saved-webp-chromium-linux.png index c1fb924d4..079c9902f 100644 Binary files a/browser_tests/tests/widget.spec.ts-snapshots/animated-image-preview-saved-webp-chromium-linux.png and b/browser_tests/tests/widget.spec.ts-snapshots/animated-image-preview-saved-webp-chromium-linux.png differ diff --git a/playwright.config.ts b/playwright.config.ts index 0bccb1582..e259c74ac 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -49,6 +49,13 @@ export default defineConfig({ grep: /@2x/ // Run all tests tagged with @2x }, + { + name: 'chromium-0.5x', + use: { ...devices['Desktop Chrome'], deviceScaleFactor: 0.5 }, + timeout: 15000, + grep: /@0.5x/ // Run all tests tagged with @0.5x + }, + // { // name: 'firefox', // use: { ...devices['Desktop Firefox'] }, diff --git a/src/lib/litegraph/src/LGraphCanvas.ts b/src/lib/litegraph/src/LGraphCanvas.ts index 3344fe5ae..6b91f1720 100644 --- a/src/lib/litegraph/src/LGraphCanvas.ts +++ b/src/lib/litegraph/src/LGraphCanvas.ts @@ -2384,6 +2384,7 @@ export class LGraphCanvas // Set the width of the line for isPointInStroke checks const { lineWidth } = this.ctx this.ctx.lineWidth = this.connections_width + 7 + const dpi = Math.max(window?.devicePixelRatio ?? 1, 1) for (const linkSegment of this.renderedPaths) { const centre = linkSegment._pos @@ -2393,7 +2394,7 @@ export class LGraphCanvas if ( (e.shiftKey || e.altKey) && linkSegment.path && - this.ctx.isPointInStroke(linkSegment.path, x, y) + this.ctx.isPointInStroke(linkSegment.path, x * dpi, y * dpi) ) { this.ctx.lineWidth = lineWidth