mirror of
https://github.com/ocornut/imgui.git
synced 2026-12-01 00:47:12 +00:00
Demo: assertion triggered when clicking two buttons that set ConfigColorEditFlags in an invalid state #9640
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#9640
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version/Branch of Dear ImGui:
Version 1.93.1/master
Back-ends:
imgui_impl_sdl3.cpp + imgui_impl_opengl3.cpp
Compiler, OS:
Linux + GCC 14
Full config/build information:
Details:
In the
Widgets->Color/Picker Widgets->Color pickerpart of the demo, clicking either theOverwrite default: Uint8 + HSV + Hue BarorOverwrite default: Float + HDR + Hue Wheelbutton triggers an assert.The first button triggers
imgui.cpp:11263: void ImGui::ErrorCheckNewFrameSanityChecks(): Assertion `ImIsPowerOfTwo(g.IO.ConfigColorEditFlags & ImGuiColorEditFlags_InputMask_)' failed.The second button triggers
imgui.cpp:11260: void ImGui::ErrorCheckNewFrameSanityChecks(): Assertion `ImIsPowerOfTwo(g.IO.ConfigColorEditFlags & ImGuiColorEditFlags_DisplayMask_)' failed.I'm not familiar at all with imgui code but after some digging this is what I've found:
ConfigColorEditFlagsneeds an input bit and a display bit but the first button sets only the display bit and the second button sets none of them.ocornut/imgui@1ddd7ee13d/imgui_demo.cpp (L1365-L1368)It seems the bug was introduced in
ocornut/imgui@0e479b9554whenImGui::SetColorEditOptions()was replaced withImGui::GetStyle().ColorEditFlags =(which was then changed toImGui::GetIO().ConfigColorEditFlags =through commit9f7d8086feandaca69173df).The problem is that
ImGui::SetColorEditOptions()was setting default bits if they were missing but now thatConfigColorEditFlagsis set directly it remains in an invalid state and triggers the assertions.It seems that adding the missing bits like this:
prevents the assertions and shows the same visual behavior as the one in the commit before the bug was introduced.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code: