mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-09 23:54:20 +00:00
Clipper: fixed an issue when using up/down from an item outside of visible bound and using the clipper. (#9079)
This commit is contained in:
parent
6ae32c696a
commit
91b5256c57
3 changed files with 9 additions and 6 deletions
|
|
@ -94,6 +94,9 @@ Other Changes:
|
|||
resizing the parent window while keeping the multi-line field active (which is
|
||||
most typically achieved when resizing programmatically or via a docking layout
|
||||
reacting to a platform window resize). (#3237, #9007) [@anton-kl, @ocornut]
|
||||
- Nav:
|
||||
- Clipper: fixed an issue when using up/down from an item outside of
|
||||
visible bound and using the clipper. (#9079)
|
||||
- Fonts:
|
||||
- Calling ImFontAtlas::Clear() mid-frame without re-adding a font will
|
||||
lead to a more explicit crash.
|
||||
|
|
|
|||
10
imgui.cpp
10
imgui.cpp
|
|
@ -3346,10 +3346,12 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
|
|||
{
|
||||
// Add range selected to be included for navigation
|
||||
const bool is_nav_request = (g.NavMoveScoringItems && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav);
|
||||
const int nav_off_min = (is_nav_request && g.NavMoveClipDir == ImGuiDir_Up) ? -1 : 0;
|
||||
const int nav_off_max = (is_nav_request && g.NavMoveClipDir == ImGuiDir_Down) ? 1 : 0;
|
||||
if (is_nav_request)
|
||||
{
|
||||
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(g.NavScoringRect.Min.y, g.NavScoringRect.Max.y, 0, 0));
|
||||
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(g.NavScoringNoClipRect.Min.y, g.NavScoringNoClipRect.Max.y, 0, 0));
|
||||
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(g.NavScoringRect.Min.y, g.NavScoringRect.Max.y, nav_off_min, nav_off_max));
|
||||
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(g.NavScoringNoClipRect.Min.y, g.NavScoringNoClipRect.Max.y, nav_off_min, nav_off_max));
|
||||
}
|
||||
if (is_nav_request && (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) && g.NavTabbingDir == -1)
|
||||
data->Ranges.push_back(ImGuiListClipperRange::FromIndices(clipper->ItemsCount - 1, clipper->ItemsCount));
|
||||
|
|
@ -3378,9 +3380,7 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
|
|||
}
|
||||
|
||||
// Add main visible range
|
||||
const int off_min = (is_nav_request && g.NavMoveClipDir == ImGuiDir_Up) ? -1 : 0;
|
||||
const int off_max = (is_nav_request && g.NavMoveClipDir == ImGuiDir_Down) ? 1 : 0;
|
||||
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(min_y, max_y, off_min, off_max));
|
||||
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(min_y, max_y, nav_off_min, nav_off_max));
|
||||
}
|
||||
|
||||
// Convert position ranges to item index ranges
|
||||
|
|
|
|||
2
imgui.h
2
imgui.h
|
|
@ -29,7 +29,7 @@
|
|||
// Library Version
|
||||
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
|
||||
#define IMGUI_VERSION "1.92.5 WIP"
|
||||
#define IMGUI_VERSION_NUM 19246
|
||||
#define IMGUI_VERSION_NUM 19247
|
||||
#define IMGUI_HAS_TABLE // Added BeginTable() - from IMGUI_VERSION_NUM >= 18000
|
||||
#define IMGUI_HAS_TEXTURES // Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue