You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a DragFloat (or DragFloatN) widget, the horizontal text alignment when not editing is in the center. However, when the user clicks to edit the drag widget, it aligns to the left (which I presume is due to input fields with center alignment not being supported). The "snapping" of alignment from center to left (and vice-versa) is personally undesirable.
The 2 possible ways to alleviate the "snapping" is to either horizontally align the text when not editing to the left (same as when editing) or changing the alignment of the input text to be centered (same as when not editing).
The first way does not seem to be supported out of the box and can only be done by modifying the imgui source code (to the best of my knowledge) at this location:
By changing the last argument passed in to RenderTextClipped function, the alignment can be changed. Hence, maybe this can somehow be exposed to the end user such that they can make their drag widgets default to horizontal left alignment (even in non-editing state).
The second way should be harder as imgui does not have support for center alignment of input text. However, I personally prefer the look of this method where both states have text horizontally centered.
Screenshots/Video:
No response
The text was updated successfully, but these errors were encountered:
Version/Branch of Dear ImGui:
Version 1.90.6, Branch: docking
Back-ends:
imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Compiler, OS:
Windows 11 + VS2022
Full config/build information:
No response
Details:
My Issue:
When using a
DragFloat
(orDragFloatN
) widget, the horizontal text alignment when not editing is in the center. However, when the user clicks to edit the drag widget, it aligns to the left (which I presume is due to input fields with center alignment not being supported). The "snapping" of alignment from center to left (and vice-versa) is personally undesirable.The 2 possible ways to alleviate the "snapping" is to either horizontally align the text when not editing to the left (same as when editing) or changing the alignment of the input text to be centered (same as when not editing).
The first way does not seem to be supported out of the box and can only be done by modifying the imgui source code (to the best of my knowledge) at this location:
imgui/imgui_widgets.cpp
Line 2539 in a18fb40
By changing the last argument passed in to
RenderTextClipped
function, the alignment can be changed. Hence, maybe this can somehow be exposed to the end user such that they can make their drag widgets default to horizontal left alignment (even in non-editing state).The second way should be harder as imgui does not have support for center alignment of input text. However, I personally prefer the look of this method where both states have text horizontally centered.
Screenshots/Video:
No response
The text was updated successfully, but these errors were encountered: