mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-24 02:14:22 +00:00
ColorEdit: fixed label overlapping when using style.ColorButtonPosition == ImGuiDir_Left. (#5912)
Amend 54fb051e5
+ Internals: added IsKeyboardKey(), IsMouseKey() helpers.
This commit is contained in:
parent
16476f99fd
commit
3a685749cb
4 changed files with 12 additions and 3 deletions
|
|
@ -5103,7 +5103,10 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
|
|||
|
||||
if (label != label_display_end && !(flags & ImGuiColorEditFlags_NoLabel))
|
||||
{
|
||||
// Position not necessarily next to last submitted button (e.g. if style.ColorButtonPosition == ImGuiDir_Left),
|
||||
// but we need to use SameLine() to setup baseline correctly. Might want to refactor SameLine() to simplify this.
|
||||
SameLine(0.0f, style.ItemInnerSpacing.x);
|
||||
window->DC.CursorPos.x = pos.x + ((flags & ImGuiColorEditFlags_NoInputs) ? w_button : w_full + style.ItemInnerSpacing.x);
|
||||
TextEx(label, label_display_end);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue