mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-10 01:50:08 +00:00
code improve for 3d node (#6403)
## Summary code improve for 3d node ## Changes 1. remove custom css 2. use tailwind instead 3. bug fix for right click context menu ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6403-code-improve-for-3d-node-29c6d73d3650819fab26feabdaa21821) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -84,6 +84,7 @@ class Load3d {
|
||||
this.renderer.setClearColor(0x282828)
|
||||
this.renderer.autoClear = false
|
||||
this.renderer.outputColorSpace = THREE.SRGBColorSpace
|
||||
this.renderer.domElement.classList.add('flex', '!h-full', '!w-full')
|
||||
container.appendChild(this.renderer.domElement)
|
||||
|
||||
this.eventManager = new EventManager()
|
||||
@@ -212,7 +213,14 @@ class Load3d {
|
||||
}
|
||||
|
||||
const contextmenuHandler = (e: MouseEvent) => {
|
||||
const wasDragging = this.rightMouseMoved
|
||||
if (this.isViewerMode) return
|
||||
|
||||
const dx = Math.abs(e.clientX - this.rightMouseDownX)
|
||||
const dy = Math.abs(e.clientY - this.rightMouseDownY)
|
||||
const wasDragging =
|
||||
this.rightMouseMoved ||
|
||||
dx > this.dragThreshold ||
|
||||
dy > this.dragThreshold
|
||||
|
||||
this.rightMouseMoved = false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user