Skip to content
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

When customizing canvas size, the graph inputs output in the subgraph cannot be clicked #391

Closed
vkerl opened this issue May 18, 2023 · 1 comment

Comments

@vkerl
Copy link
Contributor

vkerl commented May 18, 2023

The possible reason is that the click judgment in the drawButton function uses this.mouse, which I think should be using this.graph_ mouse

There is also an associated 'this. last_click_position' that needs to be modified

By doing so, he can succeed in his work

I would like to ask if this change is correct

thank you

fix code:

LGraphCanvas.prototype.processMouseDown = function(e) {
    ...
    this.last_click_position = [this.graph_mouse[0],this.graph_mouse[1]];
    ...
}
LGraphCanvas.prototype.drawButton = function( x,y,w,h, text, bgcolor, hovercolor, textcolor )
    {
        ...
        var pos = this.graph_mouse;
        var hover = LiteGraph.isInsideRectangle( pos[0], pos[1], x,yFix,w,h );
        pos = this.last_click_position;
        var clicked = pos && LiteGraph.isInsideRectangle( pos[0], pos[1], x,yFix,w,h );
        ...
    }
@jagenjo
Copy link
Owner

jagenjo commented May 18, 2023

do a PR

@vkerl vkerl closed this as completed May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants