Skip to content

Commit

Permalink
Tooltips, Drag and Drop: Fixed an issue where the fallback drag and d…
Browse files Browse the repository at this point in the history
…rop payload tooltip appeared during drag and drop release.

E.g. it would otherwise appear when releasing a color button payload.
  • Loading branch information
ocornut committed Oct 2, 2024
1 parent 004f039 commit f057541
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ Other changes:
- Scrollbar: Shift+Click scroll to clicked location (pre-1.90.8 default). (#8002, #7328)
- Scrollbar: added io.ConfigScrollbarScrollByPage setting (default to true). (#8002, #7328)
Set io.ConfigScrollbarScrollByPage=false to enforce always scrolling to clicked location.
- Tooltips, Drag and Drop: Fixed an issue where the fallback drag and drop payload tooltip
appeared during drag and drop release.
- Backends: SDL3: Update for API changes: SDL_bool removal. SDL_INIT_TIMER removal.
- Backends: WebGPU: Fixed DAWN api change using WGPUStringView in WGPUShaderSourceWGSL.
(#8009, #8010) [@blitz-research]
Expand Down
2 changes: 1 addition & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5521,7 +5521,7 @@ void ImGui::EndFrame()
// in the BeginDragDropSource() block of the dragged item, you can submit them from a safe single spot
// (e.g. end of your item loop, or before EndFrame) by reading payload data.
// In the typical case, the contents of drag tooltip should be possible to infer solely from payload data.
if (g.DragDropActive && g.DragDropSourceFrameCount < g.FrameCount && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoPreviewTooltip))
if (g.DragDropActive && g.DragDropSourceFrameCount + 1 < g.FrameCount && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoPreviewTooltip))
{
g.DragDropWithinSource = true;
SetTooltip("...");
Expand Down

0 comments on commit f057541

Please sign in to comment.