Commit Graph

11905 Commits

Author SHA1 Message Date
ocornut
6dc64cc465 DrawList: fixed build/warnings + added pretty theorical support for _StrokeLegacy in AddLineV/AddLineH
(Squash) Various zealous warning fixes. deom draw
2026-09-07 16:23:58 +02:00
Mikko Mononen
6d25a9f451 DrawList: changed CenterPixelAligned growth to be smoother, added stroke pos to AddLine()
- changed vertical AddLine() to be consistent with AddLineV()
- changed CenterPixelAligned growth to be smoother
- added (temporary) specialized stroke pos support for AddLine()
2026-09-07 16:23:58 +02:00
ocornut
293d5a5142 DrawList: added _GetStrokePos() helper indirection, made flags=0 select default at runtime. 2026-09-07 16:23:58 +02:00
ocornut
f25e4f5e5f DrawList: fixed is_truncated checks in AddRect() and AddRectFilled(). 2026-09-07 16:23:58 +02:00
ocornut
0e16f2f685 Demo: Custom Rendering: expose Stroke Position.
Demo: Custom Rendering: amend tests (to include legacy AddLine() for vertical/horizontal lines to compare.
2026-09-07 16:23:58 +02:00
Mikko Mononen
e2356aebf7 DrawList: optimize non-AA non-rounded case of AddRect() 2026-09-07 16:23:58 +02:00
Mikko Mononen
e80f7bf802 DrawList: added ImDrawFlags_StrokeCenterPixelAligned
- added ImDrawFlags_StrokeCenterPixelAligned which center aligns stroke so that outside of the stroke is pixel aligned
- fixed AddRect() non-rounded pixel aligned case to use correnct min/max
- fixed AddRect() default case to not adjust rounding for non-rounded rects
- fixed lineV() centered offset
- renamed ImDrawFlags_StrokeCenterPixelAligned to ImDrawFlags_StrokeCenterAligned.
- reduced debug build indirections.
2026-09-07 16:23:58 +02:00
ocornut
2eed449ac8 DrawList: AddRect: avoid altering rounding on StrokeOutside when initial value if 0 + comments 2026-09-07 16:23:57 +02:00
ocornut
766fd957c3 DrawList: Textured Round Corners: use macros + rename locals. (1962)
Squashed: Rename macros to IM_APPEND_VTX(), IM_APPEND_TRI()
2026-09-07 16:23:57 +02:00
Mikko Mononen
6e48756909 DrawList: Textured Round Corners: Added flags to disable textured rounded corners (1962)
- added ImFontAtlasFlags_NoBakedRoundCorners which controls if rounded corners should be baked to texture
- added ImDrawListFlags_RoundCornersUseTex which controls if we should try to use textured roudned corners
- fixed how _FringeScaleIsInteger is calculated (we want to detect integer pixel scale)
- fixed how _FringeScale is used with textured rounded corners
2026-09-07 16:23:57 +02:00
Mikko Mononen
7298a7d0f3 DrawList: Textured Round Corners: implemented faster render path for stroked rectangles. (1962)
- added check to render simpler geometry when (stroked) rectangle has integer coords
- render non.rounded with 4 non-AA rectangles
- added textures for corners of 1-3 thickness and 1-16 rounding
- use textured corners when possible, or fallback to generic one
2026-09-07 16:23:57 +02:00
Mikko Mononen
9346710933 DrawList: Textured Round Corners: first version. (1962) 2026-09-07 16:23:57 +02:00
Mikko Mononen
b95b9db799 Fixed layout/pixel-perfect issues in various widgets (w/ g_LEGACY_STROKES toggle) 2026-09-07 16:23:57 +02:00
ocornut
574d7ad93d DrawList: added ImDrawFlags_StrokeLegacy support to AddLine(). 2026-09-07 16:23:57 +02:00
Mikko Mononen
4af2aec78b DrawList: added StrokePos flags: ImDrawFlags_StrokeInside, ImDrawFlags_StrokeOutside, ImDrawFlags_StrokeCenter, ImDrawFlags_StrokeLegacy. 2026-09-07 16:23:57 +02:00
Mikko Mononen
358a03aca5 (Breaking) DrawList: removed half pixel offset from ImDrawList::AddLine()
- removed half pixel offset from ImDrawList::AddLine()
- added ImDrawList::AddHorizontalLine() and ImDrawList::AddVerticalLine() which draw line to the side of the specified line
- Change uses of AddLine() which were obviously vertical and horizontal  to use the v and h lines
- Fixed layouting issues from above changes
- Changed primitives demo to use vline and hline
- Fixed angled header to match original
- Fixed separator line to match original
- Fixed caret to match original
- Fix separator vertical alignment
- Added stroke pos, which controls how stroke is draw relative to the shape
- Kept legacy mode which does 1/2px inset
- Added stroke pos support for Rect, Circle, Ngon, and Ellipse
- add stroke pos to hline and vline
- Added drawflag ImDrawFlags_TruncateCoords which allows to hint the renderer that the input is snapped to pixels (can disable AA in some cases)
- Implemented 9-slice renderer for rounded corners
- Remove ImDrawFlags_TruncateCoords flag in favor of detecting truncated coords.
- Renamed to AddLineH(), AddLineV()
- Removed ImDrawStrokePos, folded into ImDrawFlags
2026-09-07 16:23:57 +02:00
ocornut
7e1b65d26d Merge branch 'master' into docking
# Conflicts:
#	imgui_internal.h
2026-09-02 17:27:51 +02:00
ocornut
4dbb921b22 Examples: disabled /JMC in Visual Studio projects (unnecessary overhead). 2026-09-02 17:15:39 +02:00
ocornut
e2e9533991 Added IM_NODEBUGSTEP helper. Tagged ImVec2, ImVec4, ImRect and various operators.
cc #3038. Amend 1bc6f82091, 301c956039
2026-09-02 17:13:47 +02:00
ocornut
a15761f11c TreeNode: fixed UB shifts and general tree issues when using ImGuiTreeNodeFlags_DrawLinesXXX flags and over 32 deep. (#9509)
+ fix minor typo (#9533)
2026-09-01 20:06:02 +02:00
ocornut
f562ab8e32 DrawList: reworked assert in PushTexture() to allow convenience grace period of using texture already queued for destroy during the same frame. (#9528, #8465)
Amend 131f5c57ab
2026-09-01 16:22:14 +02:00
nilFinx
e0537bf72b Fixed build issue with MacPorts Clang 16 (missing TARGET_OS_OSX). (#9498) 2026-08-31 18:42:46 +02:00
ocornut
ebc7307db5 ColorButton, RenderColorRectWithAlphaCheckerboard: fixed issues/inconsistencies with checkerboard rendering when combining color alpha and global style alpha. (#9511)
Cleanup hacks in ColorButton(). Amend d851775c80, e9ff7162b.
2026-08-31 18:04:03 +02:00
ocornut
fd74775a0d ColorButton: fixed double style alpha multiply. Remove call to GetColorU32() in RenderColorRectWithAlphaCheckerboard() for consistency. (#9511)
The main fix is the change from GetColorU32() to ColorConvertFloat4ToU32() in calling code.
The change from GetColorU32() to manual multiply in RenderColorRectWithAlphaCheckerboard() is merely for consistency with other ::Render calls.
2026-08-31 17:29:10 +02:00
ocornut
19ead810d2 ColorButton, ColorEdit, ColorPicker: cancel-out alpha caused by BeginDisabled() so disabled color buttons have the same color. (#9511) 2026-08-31 17:29:10 +02:00
ocornut
7e0de0e411 Examples: GLFW/SDL2/SDL3+WebGPU: fixed running with wgpu-native missing wgpuInstanceWaitAny(). (#9377) 2026-08-31 12:30:37 +02:00
ocornut
35a13e9948 Backends, Examples: WebGPU: further simplications. (#9377, #9532, #9530)
Suggested by @lucascompython
2026-08-31 12:23:26 +02:00
ocornut
e44b1129bd Backends, Examples: WebGPU: fixed warnings, renamed .sln, fixed SDL2+WGPU cmakefile. 2026-08-31 12:11:39 +02:00
ocornut
6d1f88fe4a Backends: WebGPU: update to build with wgpu-native 29.0+. (#9532, #9530) 2026-08-31 11:56:01 +02:00
ocornut
760dff3244 Docs: misc additions. 2026-08-31 11:32:24 +02:00
ocornut
d3c5ff395c Drags, Sliders: fixed an overflow using ImGuiSliderFlags_Logarithmic with S32/S64 types. (#9526, #3361, #1823, #1316, #642) 2026-08-30 19:44:15 +02:00
ocornut
1e51b6ffdc Comments/fixes about using IMGUI_DEFINE_MATH_OPERATORS in imconfig.h (#9524) 2026-08-28 12:40:14 +02:00
ocornut
0af8f475d1 Fixed GetBackgroundDrawList()/GetForegroundDrawList() not being properly reset every frame when cumulated session time is very large. (#9521)
Using a FrameCount for compare. Kept time as float to be consistent with other GC-related timestamps: if there is an actual need to use double we'll switch everywhere.
2026-08-23 13:05:33 +02:00
ocornut
fd13a1e892 Merge branch 'master' into docking
# Conflicts:
#	examples/example_apple_opengl2/main.mm
2026-08-19 13:39:46 +02:00
ocornut
1d7b37dc9b Tables: fix/workaround for losing display order. (#9519, #9108) 2026-08-19 13:27:31 +02:00
rubbededo
3e9d0f7e82 Backends: WebGPU: fixed passing non-integer sizes to wgpuRenderPassEncoderSetViewport(). (#9515, #8628) 2026-08-18 12:47:14 +02:00
ocornut
46d39d56fe Fixed GCC false positive. (#9508) 2026-08-07 18:42:39 +02:00
ocornut
551a0a6bc0 TextAligned, TextAlignedV: rework to always use provided width. (#7024, #9455, #1980) 2026-08-07 17:48:50 +02:00
ocornut
5de45fb1d9 Trim trailing white spaces. Changes some NULL to nullptr. 2026-08-07 16:00:53 +02:00
Daniel K. O. (dkosmari)
49fa47fc19 Added IM_FMTARGS/IM_FMTLIST to TextAligned() functions. (#1980, #9455) 2026-08-07 15:41:20 +02:00
ocornut
5b6e19bb50 Examples: Apple+OpenGL3: added new example. 2026-08-06 23:10:56 +02:00
ocornut
70e60a3c4c Examples: Apple+OpenGL2: silence warnings.
Example is precisely to demonstrate OpenGL.
2026-08-06 23:01:56 +02:00
ocornut
83f668625a Examples: OSX: fixed warning. 2026-08-06 22:53:34 +02:00
ocornut
9c473a34ce Example: GLFW+Metal: fix. 2026-08-06 22:40:28 +02:00
ocornut
de4a2990a2 Backends: Metal, Metal4: fixed resizing windows losing framebuffer scale. (#6828, #8856)
Untested for Metal4
2026-08-06 22:18:41 +02:00
ocornut
cf27a555ad Example: SDL3+Metal: fixed missing multi-viewport support. 2026-08-06 22:02:03 +02:00
ocornut
6ca5197cf8 Backends: Win32: remove unused code from an old experiment. 2026-08-06 21:50:04 +02:00
ocornut
f2ce2def09 Backends: OSX: fixed reporting backing scale as content scale (dpiscale).
Was possibly harmless because DpiScale is only used by user or certain opt-in feature.
But, Metal backend wrongly used viewport->DpiScale in ImGui_ImplMetal_SetWindowSize() so it might affect it cc #6828
2026-08-06 21:46:03 +02:00
ocornut
e236e74206 Merge branch 'master' into docking
# Conflicts:
#	backends/imgui_impl_dx12.cpp
#	backends/imgui_impl_sdl2.cpp
#	examples/example_sdl2_metal/main.mm
#	imgui_internal.h
2026-08-06 21:32:43 +02:00
ocornut
2ddb5fc095 Examples: SDL2+Metal: stop using SDL_CreateRenderer(). (#5592) 2026-08-06 21:28:57 +02:00