-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Beta UI by pythongosssss #70
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW there are also a ton of ts check errors to fix lol
|
||
// Clear fixed width and height while calculating rect so it uses 100% instead | ||
this.canvasEl.height = this.canvasEl.width = NaN; | ||
const { width, height } = this.canvasEl.getBoundingClientRect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here width
is correctly returned by height
is 0 for some calls.
|
||
// Create and mount the LiteGraph in the DOM | ||
const mainCanvas = document.createElement("canvas") | ||
mainCanvas.style.touchAction = "none" | ||
const canvasEl = (this.canvasEl = Object.assign(mainCanvas, { id: "graph-canvas" })); | ||
canvasEl.tabIndex = 1; | ||
document.body.prepend(canvasEl); | ||
this.resizeCanvas(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call is getting correct width / height
this.resizeCanvas(); | ||
window.addEventListener("resize", () => this.resizeCanvas()); | ||
const ro = new ResizeObserver(() => this.resizeCanvas()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These calls are getting height = 0
|
I think the problematic css changes are from comfyanonymous/ComfyUI#3909 |
Looks like there were some additional/unintentionall changes in your merge? These seem to be the problem, merging in 3909 works fine for me |
The |
Closes #68.
@pythongosssss There is something wrong with canvas resize. See comments. Can you take a look?