Mikko Mononen
241bf3bb05
DrawList: added explanation for IM_POLYLINE_CONVEX_POLY_MAX_BEVELS.
2026-09-21 19:10:13 +02:00
ocornut
246cfec665
Demo: Custom Rendering: added zig-zag concave shape, tweak color, tidy up section.
2026-09-21 19:10:12 +02:00
ocornut
3f6a11992b
DrawList: changed _GetStrokePos() to a macro.
2026-09-21 19:10:12 +02:00
ocornut
d073d45be9
DrawList: rename ImDrawFlags_MiterOnly->ImDrawFlags_JoinMiter, ImDrawFlags_SquareCap->ImDrawFlags_CapSquare.
2026-09-21 19:10:12 +02:00
ocornut
1647a921d8
DrawList: AddCircle, AddCircleFilled: fixed large circles being under-tessellated (when above ~140 with default CircleTessellationMaxError).
2026-09-21 19:10:12 +02:00
ocornut
4f5a2aa291
Docs: reworked Changelog, comments.
2026-09-21 19:10:11 +02:00
ocornut
bc440d38af
DrawList: rework _SelectFringeTexture() for use by third-party extensions + rename to _SelectLineTexture().
2026-09-21 19:09:02 +02:00
ocornut
b73ab8fe71
DrawList: fixed ImFontAtlasBuildUpdateTexDataCorners() packing vs render to match.
2026-09-21 19:09:02 +02:00
ocornut
7b4ff60aa5
DrawList: amend PushDrawFlag() to report reaching capacity.
2026-09-21 19:09:02 +02:00
ocornut
4d27f08dbb
DrawList: removed ImDrawFlags_UseTexForStrokeLegacy as it doesn't have any use now that legacy code is out of the way.
2026-09-21 19:09:01 +02:00
ocornut
3da12c7c4f
DrawList: simplify ImFontAtlasBuildUpdateTexDataCorners() by merging fill/strokes loops.
2026-09-21 19:09:01 +02:00
Mikko Mononen
c4eab3f44f
DrawList: fixed PathArcTo to not emit small segments.
...
- Changed PathArcTo to select start/end sample in quatized multiples of arc fast sample count
- This is done in order to avoid small segments at the start and end of the path, which causes issues with line AA ends
- Renamed CalcArcStepAndCount to CalcCornerArcStepAndCount to make it more clear that it returns the values for 90 degree arc
2026-09-21 19:09:01 +02:00
Mikko Mononen
5886eae83d
DrawList: fixed too many detailed line textures being created.
...
Fixed issue where were creating detailed line textures up to detailed witdh + 1
Changed IM_DRAWLIST_TEX_LINES_DETAILED_WIDTH_MAX to IM_DRAWLIST_TEX_LINES_DETAILED_WIDTH_COUNT which no accounts for all the detailed line textures.
2026-09-21 19:09:01 +02:00
Mikko Mononen
45ff8bdde6
DrawList: fixed rendering issues on small and degenerate shapes.
...
The "does stroke cover the whole shape" used to be overly pessimistic to stroking artifacts. This was due to the fringe, where the geometry would mess up before visually closing the shape.
Fixed the issue by adding max inner offest for the AddPolyline(), which limits the inner offset and also adjusts the texture coords.
Second part of the fix was to calculate the pass the max inner offset from the common shapes (circle, ngon, ellipse, rect).
While this does not fix all the ellipse rendering issues, it limits the issue a lot.
e.g. AddRect() w/ size=5, thickness=2 used to trigger AddRectFilled() fallback because threshold was pessimistic to prevent the AddPolyline() issues.
2026-09-21 19:09:01 +02:00
Mikko Mononen
a58770dcf8
DrawList: fixed overdraw issue for filled baked corner rendering.
...
Require all corners to fit inside the rect to avoid overdraw (or fallback to path rendering).
eg. AddRectFilled() w/ size=10, rounding=8 or 10 would break.
2026-09-21 19:09:01 +02:00
thedmd
6785e5618d
DrawList: fixed passing large thickness value (e.g. 1e20f) to thickness crashing the code.
2026-09-21 19:09:00 +02:00
ocornut
14f64016f0
DrawList: fixed AddRectFilled() path for minimum dimension.
2026-09-21 19:09:00 +02:00
ocornut
aca2bcce06
DrawList: baking half-texel in TexUvLines[] now that AddPolylineLegacy() was removed.
2026-09-21 19:09:00 +02:00
ocornut
9b90afd7a0
DrawList: ImDrawFlags_AALineEnds also requires ImDrawFlags_AALine, which makes it easier for widgets to opt-in AAEnds.
2026-09-21 19:09:00 +02:00
ocornut
2b6114b002
DrawList: fixed using ImDrawFlags_UseTexForRoundCorners when ImFontAtlasFlags_NoBakedRoundCorners has also been set.
2026-09-21 19:09:00 +02:00
ocornut
d3f6c41e80
DrawList: fixed dropping prim flags in some paths (most for ImDrawFlags_AAXXX flags).
2026-09-21 19:09:00 +02:00
Mikko Mononen
26647360b3
DrawList: fixed filled rect baked AA.
...
Always add 1px to the fill side of the rounded corner to prevent the corner AA to bleed into the rectangle edges.
2026-09-21 19:09:00 +02:00
ocornut
9db63a6d7b
DrawList: Comments. Atlas's NoBakedLines automatically disable AA at Style level. Fix passing non-Legacy stroke mask to PushDrawFlag(). Demo: Custom Rendering: use LiveEdit everywhere.
2026-09-21 19:08:59 +02:00
ocornut
712f2bd67d
TabBar: simpify TabItem rendering using stroke flags.
...
May tend toward using _StrokeInside more but _StrokeCenterBiased is closer to current behavior.
2026-09-21 19:08:59 +02:00
ocornut
5ddc33a30e
Checkbox, Menus: check marks use anti-aliased ends.
...
Currently not a satisfying resolution.
2026-09-21 19:08:59 +02:00
ocornut
3f1efd3e92
DrawList: support altering RoundCorners flags in scope as an undocumented trick/hack. (9489)
...
Not documented because it could become troublesome if treated as a guaranteed styling feature.
2026-09-21 19:08:59 +02:00
ocornut
2fd9f120bb
DrawList: removed AddPolylineLegacy(), AddConvexPolyFilledLegacy().
2026-09-21 19:08:59 +02:00
ocornut
7b2ad5a591
DrawList: removed g_LEGACY_STROKES.
2026-09-21 19:08:59 +02:00
ocornut
070461c7ce
DrawList: moved no-AA handling into _SelectFringeTexture().
2026-09-21 19:08:58 +02:00
ocornut
f5b5cd73ba
DrawList: tweak _SelectFringeTexture(). move more-unlikely screen_thickness tests within already-unlikely block. re-add removed asserts.
2026-09-21 19:08:58 +02:00
ocornut
51533d686a
Docs: update changelog.
2026-09-21 19:08:58 +02:00
ocornut
b3aef829c2
DrawList: moved _GetStrokePos() to a local inline function.
2026-09-21 19:08:58 +02:00
ocornut
03c3751a27
DrawList: added PushDrawFlag(), PopDrawFlag(), ImSmallStack_<>
2026-09-21 19:08:58 +02:00
ocornut
f57df5e380
DrawList: consistently support scope flags (ImDrawFlags::Flags) + primitive flags.
...
ImDrawFlags_AAEnds and ImDrawFlags_StrokeLegacy ok. (the most important ones).
ImDrawFlags_UseTexForRoundCorners ok.
ImDrawFlags_AAFill, ImDrawFlags_AAStrokes: for primitives: only for selected ones taking flags params. Haven't added the flag to all functions because it feels like a fringe use case.
ImDrawFlags_TextNoPixelSnap supported in RenderText(), per-prim (9417)
2026-09-21 19:08:57 +02:00
ocornut
17a62e8dd1
Demo: amend test bed to exercices more flags.
2026-09-21 19:08:57 +02:00
ocornut
2e26276f72
DrawList: comment about ImFontAtlasFlags_NoBakedLines.
2026-09-21 19:08:57 +02:00
ocornut
9838f26743
(Breaking) Obsoleted style.AntiAliasedLinesUseTex which now only makes sense for legacy strokes. Added style.AntiAliasedLineEnds.
2026-09-21 19:08:57 +02:00
ocornut
771e6dfa7a
(Breaking) DrawList: removed ImDrawListFlags_in favor of using ImDrawFlags.
2026-09-21 19:08:57 +02:00
ocornut
8fd9f44455
DrawList: new ImDrawFlags API (yet unused in this commit)
2026-09-21 19:08:56 +02:00
ocornut
1cd57d1262
DrawList: inverted ImDrawFlags_NoAAEnds into ImDrawFlags_AAEnds.
2026-09-21 19:08:56 +02:00
ocornut
440b3d7ef5
DrawList: fixed warnings, added macro to facilitate visualizing rounded corner texture usage.
2026-09-21 19:08:56 +02:00
Mikko Mononen
3879c2861b
DrawList: Optimize AddNgon()
...
- test overestimate before testing more expensive details when testing if stroked ngon is actualy filled
- Note: not a common function, but the test harness is using this to draw a triangle, which makes it show up in profiling
2026-09-21 19:08:56 +02:00
Mikko Mononen
b419b05b52
DrawList: Optimize AddRectFilled()
...
- detect and draw non-rounded non-AA rect with less branches and calculations
- improves new AddRectFilled() overhead from 30% to 5-10%
2026-09-21 19:08:56 +02:00
Mikko Mononen
8428ca8680
DrawList: Optimize _SelectFringeTexture()
...
- store inverse line thickness in the spare texture uv component (same v was stord twice) to avoid division in _SelectFringeTexture
2026-09-21 19:08:55 +02:00
ocornut
3ef6d7d89b
DrawList: surround _GetStrokePos() in IM_MSVC_RUNTIME_CHECKS_OFF macro.
2026-09-21 19:08:55 +02:00
ocornut
f230786bb2
ImFontAtlas: moved TexUv buffers and configurable defines to internals.
2026-09-21 19:08:55 +02:00
Mikko Mononen
85bee07912
DrawList: Added some comments and amended existing ones
2026-09-21 19:08:55 +02:00
Mikko Mononen
f67467e17b
DrawList: Revert texture selection to simple round() in _SelectFringeTexture
...
- revert texture selection to use just (inlined) round()
- the values were tuned to hide texture selection pops on small thickness
- since we're using super sampling for the problematic range, the tweaks are not necessayr anymore
2026-09-21 19:08:55 +02:00
Mikko Mononen
41d368b9ab
DrawList: No AA ends when line AA is disabled
2026-09-21 19:08:55 +02:00
Mikko Mononen
55fd0bc6cc
DrawList: merged _AddPolyline back into AddPolyline.
...
- AddPolyline used to call different versions of _AddPolyline, the separation is not needed anymore, one less function call in debug mode
2026-09-21 19:08:55 +02:00