mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-14 19:04:44 +00:00
ImFont::RenderText() issue #6132
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#6132
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.89.3
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: custom / erhe
Compiler: VS 2022 17.4.4
Operating System: Windows 10
My Issue/Question:
I encountered
IM_ASSERT_PARANOID()failure inImDrawList::PrimReserve()due to negative arguments being passed fromImFont::RenderText(). This was caused byspointing to one pasttext_end.text_beginpointed toMaterialandtext_endlooked valid. I am not sure exactly what path resulted inspointing totext_end + 1. I have not been able to repro, so this may be some corner case that is not easy to hit.Intuitively I imagine
ccf94e2e6ecould be at fault because it is a very-recent change that align with some of the elements of that issues. If you repro more details would be useful.Or: was text-wrapping active? that's to rule out whole chunks of code including bits that have changed.
I can now repro. This happens with
TreeNodeEx()that gets completely clipped / scrolled so that it is not visible, with flagsImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick |ImGuiTreeNodeFlags_SpanFullWidth,word_wrap_enabled == false.Perhaps
// Fast-forward to first visible lineis at fault, when there is no line at all that is visible? That code section hass = line_end + 1.Indeed the code path in my previous comment is executed and that is how
sgetstext_end + 1value.Thank you, I can repro with
#define IMGUI_DEBUG_PARANOID. Now going to lunch but going to look into this afterwards.Broken by
3482d4ec(#5720, #5919)Pushed fix
867bdbeInterestingly, it would trigger with
IMGUI_DEBUG_PARANOIDdefined, but without it would work as the count is cancelled at the end of the function (but it would run some extra code unnecessarily).Thank you!