Skip to content

In Table, Selectable highlight doesn't automatically fill row height to match TextWrapped wrapped text #9332

@GuardianDll

Description

@GuardianDll

Version/Branch of Dear ImGui:

Version v1.91.5, but bug can be reproduced on v1.92.7 as well

Back-ends:

imgui_impl_sdl2.cpp + imgui_impl_sdl2.cpp

Compiler, OS:

W10 + VS2022

Full config/build information:

Dear ImGui 1.91.5 (19150)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=199711
define: _WIN32
define: _WIN64
define: _MSC_VER=1944
define: _MSVC_LANG=201703
--------------------------------
io.BackendPlatformName: imgui_impl_sdl2
io.BackendRendererName: imgui_impl_sdlrenderer2
io.ConfigFlags: 0x00000003
 NavEnableKeyboard
 NavEnableGamepad
io.ConfigNavCaptureKeyboard
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x0000000E
 HasMouseCursors
 HasSetMousePos
 RendererHasVtxOffset
--------------------------------
io.Fonts: 2 fonts, Flags: 0x00000000, TexSize: 512,256
io.DisplaySize: 2560.00,1377.00
io.DisplayFramebufferScale: 1.00,1.00
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00

Details:

I am having a table column, inside which is a ListBox with each line being Selectable. There are cases where the length of text is too long, in which case it correctly wraps the text via TextWrapped(); unfortunately the selectable area in this case is still limited to the first line of table, so does the highlighting of the column

Screenshots/Video:

Same behavior is in https://pthom.github.io/imgui_explorer:

Image

In demo screen used in my game

Image

and in it's natural habitat in my game

Image

Minimal, Complete and Verifiable Example code:

Sorry, my code muscle isn't strong enough to separate the bit in question, but reproducible this way

  1. Go to Demo -> Tables & Columns -> Advanced
  2. Turn "show_wrapped_text" on
  3. Rearrange the description so "Description" column can be resized
  4. Resize so the wrapping starts to work

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions