mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 10:59:53 +00:00
fix: 3d resize vertically (#7621)
## Summary Fix an issue #7620 where 3D nodes could be resized vertically only in the expanding direction but could not be shrunk. ## Changes - **What**: - Allow the 3D node content container to shrink by removing `h-full` and adding `min-h-0 flex-1`. - Prevent the internal canvas from reasserting its previous height during parent resize by avoiding `h-full` and constraining it with `max-h-full`. - **Dependencies**: - None ## Review Focus - Verify that vertical resize works in both directions for 3D nodes. - Ensure the canvas still resizes correctly with the node and that three.js rendering is unaffected. - Confirm no regression in pointer events, overlays, or resize handles. ## Screenshots before https://github.com/user-attachments/assets/6b9e3bb0-98eb-4b06-adb3-b3aab60a7f86 after https://github.com/user-attachments/assets/76d1a962-6cdc-4ca4-941e-7a3874629b29 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7621-fix-3d-resize-vertically-2cd6d73d365081efb281e8a40c87bf9e) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -72,7 +72,13 @@ 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')
|
||||
this.renderer.domElement.classList.add(
|
||||
'absolute',
|
||||
'inset-0',
|
||||
'h-full',
|
||||
'w-full',
|
||||
'outline-none'
|
||||
)
|
||||
container.appendChild(this.renderer.domElement)
|
||||
|
||||
this.eventManager = new EventManager()
|
||||
@@ -609,7 +615,7 @@ class Load3d {
|
||||
}
|
||||
|
||||
handleResize(): void {
|
||||
const parentElement = this.renderer?.domElement
|
||||
const parentElement = this.renderer?.domElement?.parentElement
|
||||
|
||||
if (!parentElement) {
|
||||
console.warn('Parent element not found')
|
||||
|
||||
Reference in New Issue
Block a user