Fix litegraph grab cursor style (#2097)

This commit is contained in:
Chenlei Hu
2024-12-30 10:50:53 -05:00
committed by GitHub
parent 5218024395
commit 6dce285210
4 changed files with 8 additions and 21 deletions

View File

@@ -452,6 +452,9 @@ test.describe('Canvas Interaction', () => {
expect(await getCursorStyle()).toBe('default')
await comfyPage.page.mouse.down()
expect(await getCursorStyle()).toBe('grabbing')
// Move mouse should not alter cursor style.
await comfyPage.page.mouse.move(10, 20)
expect(await getCursorStyle()).toBe('grabbing')
await comfyPage.page.mouse.up()
expect(await getCursorStyle()).toBe('default')

8
package-lock.json generated
View File

@@ -11,7 +11,7 @@
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.4.3",
"@comfyorg/litegraph": "^0.8.50",
"@comfyorg/litegraph": "^0.8.53",
"@primevue/themes": "^4.0.5",
"@tiptap/core": "^2.10.4",
"@tiptap/extension-link": "^2.10.4",
@@ -1965,9 +1965,9 @@
"license": "GPL-3.0-only"
},
"node_modules/@comfyorg/litegraph": {
"version": "0.8.50",
"resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.8.50.tgz",
"integrity": "sha512-sBwiXySHHjNmHQ4erf53cYsArXAAdFBAPY7/g+1Sp6aWA4krrLekD3yHmetgbfKq/pUy/MbZ8JgHTd68rx0mhg==",
"version": "0.8.53",
"resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.8.53.tgz",
"integrity": "sha512-ihgHGAFVWzeWobhYA4pLRIlqykGwznZQM9gq2KRMs6FOYW1TrbFjbI2GvXZs93wkzXkoY8swwsQitBD7MklT3w==",
"license": "MIT"
},
"node_modules/@cspotcode/source-map-support": {

View File

@@ -80,7 +80,7 @@
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.4.3",
"@comfyorg/litegraph": "^0.8.50",
"@comfyorg/litegraph": "^0.8.53",
"@primevue/themes": "^4.0.5",
"@tiptap/core": "^2.10.4",
"@tiptap/extension-link": "^2.10.4",

View File

@@ -219,22 +219,6 @@ watch(
}
)
watchEffect(() => {
if (!canvasStore.canvas) return
if (canvasStore.canvas.state.draggingCanvas) {
canvasStore.canvas.canvas.style.cursor = 'grabbing'
return
}
if (canvasStore.canvas.state.readOnly) {
canvasStore.canvas.canvas.style.cursor = 'grab'
return
}
canvasStore.canvas.canvas.style.cursor = 'default'
})
const colorPaletteService = useColorPaletteService()
watchEffect(() => {
if (!canvasStore.canvas) return