mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 03:58:47 +02:00
ColorEdit: fixed label overlapping when using style.ColorButtonPosition == ImGuiDir_Left. (#5912)
Amend 54fb051e5
+ Internals: added IsKeyboardKey(), IsMouseKey() helpers.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user