mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-05 22:15:45 +01:00
ColorButton, ColorEdit, ColorPicker: fixed an issue rendering colors when inside a BeginDisabled(false) block. (#9511, #9613, #9614)
This commit is contained in:
parent
253aa51aba
commit
dbb30112c6
@ -98,6 +98,10 @@ Other Changes:
|
||||
end of storage when trailing items are unselected (#9604) [@MilosLord]
|
||||
- Drags: fixed handling of `ImGuiSliderFlags_WrapAround`: value could temporarily
|
||||
escape the range when dragging fast. (#9612, #9611, #7749) [@swayie, @ocornut]
|
||||
- ColorEdit:
|
||||
- ColorButton, ColorEdit, ColorPicker: fixed an issue rendering colors when
|
||||
inside a `BeginDisabled(false)` block, caused by the alpha cancelling-out
|
||||
code in 1.93.0. (#9511, #9613, #9614) [@tksuoran]
|
||||
- ImVec2: added a check for cases where a custom `IM_VEC2_CLASS_EXTRA` macro
|
||||
adds an extra `operator=` to ImVec2. This isn't supported but should not
|
||||
be needed as you should have a constructor to convert from your type to ImVec2.
|
||||
|
||||
@ -6217,7 +6217,8 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
|
||||
g.NextItemData.ClearFlags();
|
||||
|
||||
const float backup_alpha = g.Style.Alpha;
|
||||
if (g.DisabledStackSize > 0)
|
||||
const bool is_disabled = (g.CurrentItemFlags & ImGuiItemFlags_Disabled) != 0 && (g.DisabledStackSize > 0); // Intentionally not check ItemFlagsSet
|
||||
if (is_disabled)
|
||||
g.Style.Alpha = g.DisabledAlphaBackup; // Cancel out effect of BeginDisabled() for color swatches.
|
||||
|
||||
PushID(label);
|
||||
@ -6579,7 +6580,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
|
||||
g.ColorEditCurrentID = 0;
|
||||
PopID();
|
||||
|
||||
if (g.DisabledStackSize > 0)
|
||||
if (is_disabled)
|
||||
g.Style.Alpha = backup_alpha;
|
||||
|
||||
return value_changed;
|
||||
@ -6620,7 +6621,8 @@ bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFl
|
||||
const bool is_mixed = (g.LastItemData.ItemFlags & ImGuiItemFlags_MixedValue) != 0;
|
||||
|
||||
const float backup_alpha = g.Style.Alpha;
|
||||
if (g.DisabledStackSize > 0)
|
||||
const bool is_disabled = (g.CurrentItemFlags & ImGuiItemFlags_Disabled) != 0 && (g.DisabledStackSize > 0); // Intentionally not use LastItemData.ItemFlags here.
|
||||
if (is_disabled)
|
||||
g.Style.Alpha = g.DisabledAlphaBackup; // Cancel out effect of BeginDisabled() for color swatches.
|
||||
if (is_mixed)
|
||||
{
|
||||
@ -6648,7 +6650,7 @@ bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFl
|
||||
else
|
||||
window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(col_source), rounding);
|
||||
}
|
||||
if (g.DisabledStackSize > 0)
|
||||
if (is_disabled)
|
||||
g.Style.Alpha = backup_alpha;
|
||||
RenderNavCursor(bb, id);
|
||||
if ((flags & ImGuiColorEditFlags_NoBorder) == 0)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user