Commit 7c06865
fix: disambiguate Drop Target button IDs in Drag'N'Drop demo (#387)
The demo renders three drop-target buttons whose labels share the same
value of the mutable 'data' field, so imgui hashes three identical
item IDs within the same window. This was silently broken pre-1.91
(drop zones shared hover/active state) and surfaces as a visible
"3 visible items with conflicting ID!" warning now that imgui 1.91's
ConfigDebugHighlightIdConflicts is on by default in debug builds.
Wrap each drop-target block in a PushID("any"/"string"/"class") /
PopID() pair so the buttons share a human-readable label but are
distinguished in the ID stack. This is the resolution imgui's own
warning recommends first.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 336de93 commit 7c06865
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| 53 | + | |
49 | 54 | | |
50 | 55 | | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| |||
0 commit comments