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

Small error in TreeNodeBehavior #6549

Closed
BobbyAnguelov opened this issue Jun 25, 2023 · 2 comments
Closed

Small error in TreeNodeBehavior #6549

BobbyAnguelov opened this issue Jun 25, 2023 · 2 comments
Labels
tree tree nodes

Comments

@BobbyAnguelov
Copy link

Tiny typo on line 6257 (in docking branch) dealing with the rendering of leaf text without a bullet in a framed item does not take the padding into account:

else // Leaf without bullet, left-adjusted text
    text_pos.x -= text_offset_x;

should probably read:

else // Leaf without bullet, left-adjusted text
    text_pos.x -= text_offset_x - padding.x;

This would be consistent with all the other rendering positions in that function

@ocornut ocornut added the tree tree nodes label Jun 26, 2023
@ocornut
Copy link
Owner

ocornut commented Jun 26, 2023

Right, I pushed the change as 0a53b45.

Out of curiosity did you notice this because have WindowPadding.x == 0?
CollapsingHeader() have this legacy-ish behavior where they extend themselves by WindowPadding.x*0.5f on left and right side. So normally you would see this padding and under default settings it looks ok.

I'm however considering to make changes to this (see #3312, #6170) which should involve removing the code that pads InnerClipRect, and maybe alter the code in TreeNodeBehavior() to use another source for the outer-padding value.

@ocornut ocornut closed this as completed Jun 26, 2023
@BobbyAnguelov
Copy link
Author

I actually had window padding set to 8, but noticed that the "header" text was not respecting the frame padding and was stuck to the left edge of the header frame. It was for a custom widget using the TreeViewEx functions so maybe that's the difference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tree tree nodes
Projects
None yet
Development

No branches or pull requests

2 participants