mirror of
https://github.com/ocornut/imgui.git
synced 2026-10-29 07:54:40 +00:00
Adding overbars/overlines to text, for indicating i.e. inverted signal names. #9579
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#9579
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.92, Branch: docking
Back-ends:
imgui_impl_opengl3.cpp + imgui_impl_vulkan.cpp
Compiler, OS:
Windows, Linux / GCC, Clang
Details:
I'd like to implement rendering KiCAD style signal labels, indicating inversed polarity by overlining the signal name. In KiCAD the markup used for this is
~{…}. I can think of several ways to implement this:ImGui::OverlinedTextfunctionBefore I charge ahead I'd like collect suggestions and comments on the idea. Any specifics you can think of that might throw me curveballs there?
This is going to be the easiest route.
See what
ImGui::TextLink()is doing:If they are single line labels you can call
ImGui::Text()then readGetItemRectMin()/GetItemRectMax()and apply.I recommend updating to latest git hash on docking as this code changed recently.
Note what we are currently fixing various small issues with font metrics and it is possible what your offset calculating might change slightly to be correct in future versions, but it's going to be an easy change.
This is going to be sit over the above code anyhow. This is only going to be useful if you want to submit a large blob of rich/markup text at once. If your labels are submitted by code that derived them from data them a simple helper just to draw the line is enough.
Those are not supported by our text rendering functions.