DrawList: added emojis. added notes on AddRect() changes.

ocornut 2026-05-28 14:38:49 +02:00
parent fdfb885d50
commit 2593ee5c05

@ -94,7 +94,9 @@ Draws line from **p1** to **p2** with specified color and thickness. Default thi
If you need to draw a continuous line, prefer to use `AddPolyline()` or `PathStroke()` instead as they will join the lines together. For strictly horizontal or vertical lines, prefer to use `AddLineH()` and `AddLineV()`. They have additional optimizations for the cases when you are drawing pixel perfect lines.
<details>
<summary><b>Changes from versions < 1.93</b></summary>
<summary><b>🚧 Changes from versions < 1.93</b></summary>
🚨 **Version 1.93.0**
Before: `AddLine()` used to have 0.5px offset applied to the end points. Together with no-AA line ends, the line would render as if the points were pixel center coordinates. Sometime it worked, and sometimes it did not and it was hard to reason why.
@ -153,7 +155,9 @@ The "inside" of the shape below the line. You can think the horizontal line as t
Optimized rendering is used, if the horizontal line is drawn on integer coordinates, integer thickness, and the stroke offset is Inside or Outside.
<details>
<summary><b>Changes from versions < 1.93</b></summary>
<summary><b>🚧 Changes from versions < 1.93</b></summary>
🚨 **Version 1.93.0**
`AddLineH()` used to be implemented similarly as `AddLine()` and had the same 0.5px offset and missing anti-aliased end caps.
@ -185,7 +189,9 @@ The "inside" of the shape right of the line. You can think the vertical line as
Optimized rendering is used, if the vertical line is drawn on integer coordinates, integer thickness, and the stroke offset is Inside or Outside.
<details>
<summary><b>Changes from versions < 1.93</b></summary>
<summary><b>🚧 Changes from versions < 1.93</b></summary>
🚨 **Version 1.93.0**
`AddLineV()` used to have the same 0.5px offset as AddLine(). The offset was removed,.
@ -221,7 +227,25 @@ Corner rounding is clamped to fit inside the rectangle bounds.
Optimized rendering is used if the coordinates and thickness are integer, and rounding is small integer and stroke position is Inside or Outside.
<details>
<summary><b>Changes from versions < 1.93</b></summary>
<summary><b>🚧 Changes from versions < 1.93</b></summary>
🚨 **Version 1.92.8 (2026-05)**
Swapped the trailing parameters `flags` and `thickness`:
Before 1.92.8:
- `void AddRect(ImVec2 p_min, ImVec2 p_max, ImU32 col, float rounding = 0.0f, ImDrawFlags flags = 0, float thickness = 1.0f);`
After 1.92.8:
- `void AddRect(ImVec2 p_min, ImVec2 p_max, ImU32 col, float rounding = 0.0f, float thickness = 1.0f, ImDrawFlags flags = 0);`
Added inline redirection functions when `IMGUI_DISABLE_OBSOLETE_FUNCTIONS` is off. Marked the old functions are =delete when `IMGUI_DISABLE_OBSOLETE_FUNCTIONS` is on, to allow for better type-checking. Effectively the typical call site is changing from:
- `draw_list->AddRect(p_min, p_max, color, rounding, ImDrawFlags_None, border_size);`
- to `draw_list->AddRect(p_min, p_max, color, rounding, border_size);`
Users of C++ and other languages with type-checking will be notified at compile-time of any mistakes. Users of high-level bindings or languages with no type-checking will be notified at runtime via an assert for invalid flags value. Refer to [Changelog](https://github.com/ocornut/imgui/blob/master/docs/CHANGELOG.txt) for more details.
🚨 **Version 1.93.0**
`AddRect()` used to have fixed 0.5px inset. This meant that a 1px line draw was drawn inside the shape, which works well when rendering widgets.
@ -259,7 +283,9 @@ Draws filled rectangle from **p_min** (top-left) to **p_max** ( bottom-right), w
Optimized rendering is used when the coordinates are integer, and rounding is small integer.
<details>
<summary><b>Changes from versions < 1.93</b></summary>
<summary><b>🚧 Changes from versions < 1.93</b></summary>
🚨 **Version 1.93.0**
`AddRectFilled()` used to always draw non-rounded rectangle without anti-aliasing. Now it renders with anti-aliasing. The optimized rendering case for integer coords matches the previous non-AA rendering.
@ -291,7 +317,9 @@ Draws stroked circle at **center** using **radius**, with specified color and th
The rendering code handles corners cases robustly, like stroke thickness that would completely cover the inside of the shape will fallback to rendering to filled circle instead.
<details>
<summary><b>Changes from versions < 1.93</b></summary>
<summary><b>🚧 Changes from versions < 1.93</b></summary>
🚨 **Version 1.93.0**
`AddCircle()` used to have fixed 0.5px inset. This meant that a 1px line draw was drawn inside the shape.
@ -316,7 +344,9 @@ The default rotation is *0*, segment count is *0* (calculate count automatically
Stroked ellipse drawing is more complicated than other shapes and it does not handle all degenerate inputs, like thick thickness compared to ellipse size, as well as other shapes.
<details>
<summary><b>Changes from versions < 1.93</b></summary>
<summary><b>🚧 Changes from versions < 1.93</b></summary>
🚨 **Version 1.93.0**
The ellipse used to have center stroke position, it is not changed inside to be consistent with other primitive shapes.
@ -345,7 +375,9 @@ The default thickness is **1.0**, and default stroke position is **Inside**. Str
The rendering code handles corners cases robustly, like stroke thickness that would completely cover the inside of the shape will fallback to rendering to filled ngon instead.
<details>
<summary><b>Changes from versions < 1.93</b></summary>
<summary><b>🚧 Changes from versions < 1.93</b></summary>
🚨 **Version 1.93.0**
`AddNGon()` used to have fixed 0.5px inset. This meant that a 1px line draw was drawn inside the shape.
@ -400,7 +432,13 @@ For example, then the stroke position is inside, the stroke will be crips as lon
**Inside is right of the path direction.** The pictures of the shapes in this document shows the inside/ outside and an arrow indicating the line direction.
<details>
<summary><b>Changes from versions < 1.93</b></summary>
<summary><b>🚧 Changes from versions < 1.93</b></summary>
🚨 **Version 1.92.8 (2026-05)**
Swapped the trailing parameters `flags` and `thickness`. See `AddRect()` section for details.
🚨 **Version 1.93.0**
The algorithm to render lines got overhauled.
@ -423,7 +461,9 @@ The rendering expands small faded fringe around the polygon for anti-aliasing. T
Shapes that do not have very sharp corners, can use `ImDrawFlags_MiterOnly` draw flag for faster rendering. When this flag is set, some safety measures are skipped, like beveling sharp corners. A good rule of thumb is that if your shape has 90 degree or rounded corners, you should be able to use this flag.
<details>
<summary><b>Changes from versions < 1.93</b></summary>
<summary><b>🚧 Changes from versions < 1.93</b></summary>
🚨 **Version 1.93.0**
`PathFillConvex()` was improved to handle input geometry more robustly.