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

Fix scrollbar rect not respecting border size in all cases #8267

Closed
wants to merge 1 commit into from

Conversation

dfalcone
Copy link

@dfalcone dfalcone commented Dec 28, 2024

Steps to repro:

  1. open the imgui_examples project and run it
  2. open style editor, set the child border size to 6 or higher to see bug clearly using arrow keys and enter key to set custom size
  3. navigate to scrolling section, observe the scrollbar placements for vertical and horizontal

Result:
Before this bug fix, the window border overlaps the top of the scrollbar for vertical and left of the scrollbar for horizontal.

(size 12 to be very obvious)
image

Image Fixed (size 6):
image

@ocornut ocornut added the style label Dec 29, 2024
@ocornut ocornut changed the title fix scrollbar rect not respecting border size in all cases, most noti… Fix scrollbar rect not respecting border size in all cases Jan 24, 2025
@ocornut
Copy link
Owner

ocornut commented Jan 24, 2025

Hello,
Thanks for your PR.

Thick borders are generally not well supported, see #7887
I am not sure it is wise to add this change

  • (1) it's incorrect in various ways. the y1 of a vertical scroll shouldn't be offset if the border isn't reaching the scrollbar, which typically doesn't happen if there's a title bar or a menu bar. It should also generally move things by half border-size, not border-size.
    1. They are other too many things that are equally broken which very thick borders (e.g. menu bars are clippied, resize grip looks odd). Ideally they'd be fixed together.

My goal would be to move the border to be inside window, as shown in #7887 (comment) but it requires a rounding rendering fix which I don't have now. It would largely simplify all those fixes so I'm banking on that, but for now happy to keep this open as an extra reminder there's an unsolved problem.

ocornut added a commit that referenced this pull request Jan 24, 2025
…ip and scrollbar when using thick border sizes. (#8267, #7887)

Amend e.g. 742b5f4.
@ocornut
Copy link
Owner

ocornut commented Jan 24, 2025

I decided to go ahead and work on fixing more situations with thick borders, and pushed 9bc5b04
This should fix the scrollbars but also various other issues related to menu bar and resize grip.

@ocornut ocornut closed this Jan 24, 2025
@ocornut
Copy link
Owner

ocornut commented Jan 24, 2025

Adding a link to f5d1852 (#6861, #2884) which was a fix for Docking has this will be impacted during merging.

ocornut added a commit that referenced this pull request Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants