Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImGuiColorEditFlags_NoInputs flag hide inputs but keep space #2955

Closed
aiekick opened this issue Dec 29, 2019 · 1 comment
Closed

ImGuiColorEditFlags_NoInputs flag hide inputs but keep space #2955

aiekick opened this issue Dec 29, 2019 · 1 comment

Comments

@aiekick
Copy link
Contributor

aiekick commented Dec 29, 2019

ImGui : 1.74
Branch : Master

the ImGuiColorEditFlags_NoInputs applied in ColorEdit3 or ColorEdit4
keep the space (used by inputs)

the first line is without ImGuiColorEditFlags_NoInputs
the second line is with ImGuiColorEditFlags_NoInputs
NoodlesPlate_MSVC_Debug_AmayS0MaLg

i have fixed this problem like that (at line 4348 of imgui_widgets.cpp
(but not sure if it work in all cases, mines are ok)

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

become :

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

the result :
NoodlesPlate_MSVC_Debug_Cwb7FPvFPh

rokups added a commit to rokups/imgui that referenced this issue Jan 6, 2020
rokups added a commit to rokups/imgui that referenced this issue Jan 6, 2020
@ocornut
Copy link
Owner

ocornut commented Jan 6, 2020

Fixed with correct inner spacing by e254167.

@ocornut ocornut closed this as completed Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants