Skip to content

Commit

Permalink
Fix text alignment of ColorEdit widgets with ImGuiColorEditFlags_NoIn…
Browse files Browse the repository at this point in the history
…puts flag.

Fixes ocornut#2955.
  • Loading branch information
rokups committed Jan 6, 2020
1 parent 2a81535 commit cf9f8ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4344,7 +4344,8 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag

if (label != label_display_end && !(flags & ImGuiColorEditFlags_NoLabel))
{
window->DC.CursorPos = ImVec2(pos.x + w_full + style.ItemInnerSpacing.x, pos.y + style.FramePadding.y);
const float text_offset_x = flags & ImGuiColorEditFlags_NoInputs ? w_button : w_full + style.ItemInnerSpacing.x;
window->DC.CursorPos = ImVec2(pos.x + text_offset_x, pos.y + style.FramePadding.y);
TextEx(label, label_display_end);
}

Expand Down

0 comments on commit cf9f8ec

Please sign in to comment.