mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-21 23:34:31 +00:00
## Summary
Create a composable for useRenderModeSetting that lets you set a setting
for either vue or litegraph and once set remembers each state
respectively.
```
useRenderModeSetting(
{ setting: 'LiteGraph.Canvas.MinFontSizeForLOD', vue: 0, litegraph: 8 },
shouldRenderVueNodes
)
```
## Screenshots (if applicable)
<img width="1611" height="997" alt="image"
src="https://github.com/user-attachments/assets/621930f2-2d21-4c86-a46d-e3e292d4e012"
/>
<img width="1611" height="997" alt="chrome_Gr1V3P6sJi"
src="https://github.com/user-attachments/assets/eb63b747-487f-4f5e-8fcf-f0d2ff97b976"
/>
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6755-feat-LOD-setting-for-LG-and-Vue-2b16d73d365081cbbf09c292ee3c0e96)
by [Unito](https://www.unito.io)
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import {
|
|
comfyExpect as expect,
|
|
comfyPageFixture as test
|
|
} from '../../../../fixtures/ComfyPage'
|
|
|
|
test.describe('Vue Nodes Zoom', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.setSetting('Comfy.VueNodes.Enabled', true)
|
|
await comfyPage.setSetting('LiteGraph.Canvas.MinFontSizeForLOD', 8)
|
|
await comfyPage.vueNodes.waitForNodes()
|
|
})
|
|
|
|
test('should not capture drag while zooming with ctrl+shift+drag', async ({
|
|
comfyPage
|
|
}) => {
|
|
const checkpointNode = comfyPage.vueNodes.getNodeByTitle('Load Checkpoint')
|
|
const nodeBoundingBox = await checkpointNode.boundingBox()
|
|
if (!nodeBoundingBox) throw new Error('Node bounding box not available')
|
|
|
|
const nodeMidpointX = nodeBoundingBox.x + nodeBoundingBox.width / 2
|
|
const nodeMidpointY = nodeBoundingBox.y + nodeBoundingBox.height / 2
|
|
|
|
// Start the Ctrl+Shift drag-to-zoom on the canvas and continue dragging over
|
|
// the node. The node should not capture the drag while drag-zooming.
|
|
await comfyPage.page.keyboard.down('Control')
|
|
await comfyPage.page.keyboard.down('Shift')
|
|
await comfyPage.dragAndDrop(
|
|
{ x: 200, y: 300 },
|
|
{ x: nodeMidpointX, y: nodeMidpointY }
|
|
)
|
|
|
|
await expect(comfyPage.canvas).toHaveScreenshot('zoomed-in-ctrl-shift.png')
|
|
})
|
|
})
|