|
@@ -5114,16 +5114,19 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
|
|
|
|
|
|
if (BeginPopup("picker"))
|
|
|
{
|
|
|
- picker_active_window = g.CurrentWindow;
|
|
|
- if (label != label_display_end)
|
|
|
+ if (g.CurrentWindow->BeginCount == 1)
|
|
|
{
|
|
|
- TextEx(label, label_display_end);
|
|
|
- Spacing();
|
|
|
+ picker_active_window = g.CurrentWindow;
|
|
|
+ if (label != label_display_end)
|
|
|
+ {
|
|
|
+ TextEx(label, label_display_end);
|
|
|
+ Spacing();
|
|
|
+ }
|
|
|
+ ImGuiColorEditFlags picker_flags_to_forward = ImGuiColorEditFlags_DataTypeMask_ | ImGuiColorEditFlags_PickerMask_ | ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaBar;
|
|
|
+ ImGuiColorEditFlags picker_flags = (flags_untouched & picker_flags_to_forward) | ImGuiColorEditFlags_DisplayMask_ | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_AlphaPreviewHalf;
|
|
|
+ SetNextItemWidth(square_sz * 12.0f); // Use 256 + bar sizes?
|
|
|
+ value_changed |= ColorPicker4("##picker", col, picker_flags, &g.ColorPickerRef.x);
|
|
|
}
|
|
|
- ImGuiColorEditFlags picker_flags_to_forward = ImGuiColorEditFlags_DataTypeMask_ | ImGuiColorEditFlags_PickerMask_ | ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaBar;
|
|
|
- ImGuiColorEditFlags picker_flags = (flags_untouched & picker_flags_to_forward) | ImGuiColorEditFlags_DisplayMask_ | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_AlphaPreviewHalf;
|
|
|
- SetNextItemWidth(square_sz * 12.0f); // Use 256 + bar sizes?
|
|
|
- value_changed |= ColorPicker4("##picker", col, picker_flags, &g.ColorPickerRef.x);
|
|
|
EndPopup();
|
|
|
}
|
|
|
}
|
|
@@ -5186,7 +5189,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
|
|
|
if (picker_active_window && g.ActiveId != 0 && g.ActiveIdWindow == picker_active_window)
|
|
|
g.LastItemData.ID = g.ActiveId;
|
|
|
|
|
|
- if (value_changed)
|
|
|
+ if (value_changed && g.LastItemData.ID != 0) // In case of ID collision, the second EndGroup() won't catch g.ActiveId
|
|
|
MarkItemEdited(g.LastItemData.ID);
|
|
|
|
|
|
return value_changed;
|
|
@@ -5574,7 +5577,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
|
|
|
|
|
|
if (value_changed && memcmp(backup_initial_col, col, components * sizeof(float)) == 0)
|
|
|
value_changed = false;
|
|
|
- if (value_changed)
|
|
|
+ if (value_changed && g.LastItemData.ID != 0) // In case of ID collision, the second EndGroup() won't catch g.ActiveId
|
|
|
MarkItemEdited(g.LastItemData.ID);
|
|
|
|
|
|
PopID();
|