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

Occupying the whole node area with a custom widget #422

Open
EssenOH opened this issue Jun 8, 2024 · 2 comments
Open

Occupying the whole node area with a custom widget #422

EssenOH opened this issue Jun 8, 2024 · 2 comments

Comments

@EssenOH
Copy link

EssenOH commented Jun 8, 2024

I am trying to place a custom widget occupying entire node area, but I got following result :

image

I'd like to make it such as following :

image

so, I have assigned input port without name, and didn't assign output port, but the custom node always keep some space from the input port as the picture.

@jack-mil
Copy link
Contributor

Likely related to #402

@EssenOH
Copy link
Author

EssenOH commented Jun 15, 2024

What do you think about this change ?

    # width = port_width + max([text_w, port_text_width]) + side_padding
    # height = max([text_h, p_input_height, p_output_height, widget_height])
    # if widget_width:
    #     # add additional width for node widget.
    #     width += widget_width

    height = max([text_h, p_input_height, p_output_height, widget_height])
    if widget_width:
        # add additional width for node widget.
        if port_text_width:
            width = port_width + max([text_w, port_text_width]) + side_padding
            width += widget_width
        else:
            width = port_width + max([text_w, widget_width])
    else:
        width = port_width + max([text_w, port_text_width]) + side_padding

    if widget_height:
        # add bottom margin for node widget.
        height += 2.0
    height *= 1.05
    return width, height

image

Still, there is some space on left side, but it is much better than before.

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