Skip to content

Conversation

DomGries
Copy link
Contributor

  • An item which is barely visible (1px) was not being visibly focused
  • Scrolling to an invisible item was improved to indicate scroll direction instead of simply centering it

Closes #2812

- An item which is barely visible (1px) was not being visibly focused
- Scrolling to an invisible item was improved to indicate scroll direction instead of simply centering it

Closes #2812
@ocornut ocornut added scrolling nav keyboard/gamepad navigation labels Sep 30, 2019
ocornut pushed a commit that referenced this pull request Mar 10, 2023
@ocornut
Copy link
Owner

ocornut commented Mar 10, 2023

Apologies for missing this.
AFAIK a similar change has been pushed as part of 44f8011

ScrollToRectEx() is the new name for what was ScrollToBringRectIntoView() and it has variety of flags, the call here use default flag.

"An item which is barely visible (1px) was not being visibly focused"
but the current version still had the faulty if (!IsItemVisible()) test
Which I have replaced with

    if (!window->ClipRect.Contains(g.LastItemData.Rect))
        ScrollToRectEx(window, g.LastItemData.Rect, ImGuiScrollFlags_None);

I took the liberty to attribute you that modified commit: 6ca1556

"Scrolling to an invisible item was improved to indicate scroll direction instead of simply centering it"
this was done with 44f8011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nav keyboard/gamepad navigation scrolling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SetItemDefaultFocus scroll improvement suggestions
2 participants