From 063521d26fdf0fd504c11c5f5669197a2ec9dcf7 Mon Sep 17 00:00:00 2001 From: Mikko Mononen Date: Thu, 28 May 2026 14:06:37 +0200 Subject: [PATCH] Added draw list references # Conflicts: # Draw-List.md --- Draw-List.md | 501 +++++++++++++++++++++++++++++++ drawlist/bezier_cubic_basics.svg | 16 + drawlist/bezier_quad_basics.svg | 14 + drawlist/circle_basics.svg | 12 + drawlist/ellipse_basics.svg | 20 ++ drawlist/line_0.svg | 29 ++ drawlist/line_1.svg | 33 ++ drawlist/line_2.svg | 30 ++ drawlist/line_3.svg | 29 ++ drawlist/line_basics.svg | 10 + drawlist/line_flags.svg | 16 + drawlist/lineh_0.svg | 29 ++ drawlist/lineh_1.svg | 28 ++ drawlist/lineh_basics.svg | 11 + drawlist/linev_0.svg | 30 ++ drawlist/linev_1.svg | 30 ++ drawlist/linev_basics.svg | 11 + drawlist/miter_only.svg | 43 +++ drawlist/ngon_basics.svg | 11 + drawlist/polyline_0.svg | 23 ++ drawlist/polyline_basics.svg | 37 +++ drawlist/quad_basics.svg | 17 ++ drawlist/rect_0.svg | 51 ++++ drawlist/rect_1.svg | 91 ++++++ drawlist/rect_2.svg | 63 ++++ drawlist/rect_basics.svg | 10 + drawlist/rect_filled_0.svg | 45 +++ drawlist/rect_filled_1.svg | 51 ++++ drawlist/stroke_pos.svg | 160 ++++++++++ drawlist/stroke_pos_all.svg | 392 ++++++++++++++++++++++++ drawlist/triangle_basics.svg | 14 + 31 files changed, 1857 insertions(+) create mode 100644 Draw-List.md create mode 100644 drawlist/bezier_cubic_basics.svg create mode 100644 drawlist/bezier_quad_basics.svg create mode 100644 drawlist/circle_basics.svg create mode 100644 drawlist/ellipse_basics.svg create mode 100644 drawlist/line_0.svg create mode 100644 drawlist/line_1.svg create mode 100644 drawlist/line_2.svg create mode 100644 drawlist/line_3.svg create mode 100644 drawlist/line_basics.svg create mode 100644 drawlist/line_flags.svg create mode 100644 drawlist/lineh_0.svg create mode 100644 drawlist/lineh_1.svg create mode 100644 drawlist/lineh_basics.svg create mode 100644 drawlist/linev_0.svg create mode 100644 drawlist/linev_1.svg create mode 100644 drawlist/linev_basics.svg create mode 100644 drawlist/miter_only.svg create mode 100644 drawlist/ngon_basics.svg create mode 100644 drawlist/polyline_0.svg create mode 100644 drawlist/polyline_basics.svg create mode 100644 drawlist/quad_basics.svg create mode 100644 drawlist/rect_0.svg create mode 100644 drawlist/rect_1.svg create mode 100644 drawlist/rect_2.svg create mode 100644 drawlist/rect_basics.svg create mode 100644 drawlist/rect_filled_0.svg create mode 100644 drawlist/rect_filled_1.svg create mode 100644 drawlist/stroke_pos.svg create mode 100644 drawlist/stroke_pos_all.svg create mode 100644 drawlist/triangle_basics.svg diff --git a/Draw-List.md b/Draw-List.md new file mode 100644 index 0000000..6a06693 --- /dev/null +++ b/Draw-List.md @@ -0,0 +1,501 @@ +# ImDrawList Vector Rendering Reference + +## Overview + +The ImGui DrawList has number of methods to draw anti-aliased vector shapes. + +The shapes can be divided into two categories: + +- **Primitives**: `AddLineH()`, `AddLineV()`, `AddRect()`, `AddQuad()`, `AddNGon()`, `AddTriangle()`, `AddCircle()`, `AddEllipse()`. +
These are generally used for composing UI shapes, their default for 1px lines were to draw the line inside the shape. + +- **Paths**: `AddLine()`, `AddBezierCubic()`, `AddBezierQuadratic()`, `AddPolyline()`, `AddConvexPolyFilled()`, `PathStroke()`, `PathFillConvex()`, `PathFillConcave()`. +
They are generally used to draw data visualizations, and other more freeform content, and many had center behavior before. + +The `PathStroke()`, `PathFillConvex()`, and `PathFillConcave()` are used along with the stateful path API, which allows to build the path to be filled or storked one feature at a time. + +## Draw Flags (`ImDrawFlags`) + +Some draw functions take draw flags as the last parameter. The flags define optional features, some of which are shape speicfic. + +### Corner Rounding + +Applies for `AddRect()`, `AddRectFilled()`, and `PathRect()`. + +- **ImDrawFlags_RoundCornersTopLeft**: round top-left corner +- **ImDrawFlags_RoundCornersTopRight**: round top-right corner +- **ImDrawFlags_RoundCornersBottomLeft**: round bottom-left corner +- **ImDrawFlags_RoundCornersBottomRight**: round bottom-right corner +- **ImDrawFlags_RoundCornersNone**: disable rounding +- **ImDrawFlags_RoundCornersAll**: round all corners + +When not specified and `rounding` > 0, the default is **ImDrawFlags_RoundCornersAll**. Use **ImDrawFlags_RoundCornersNone** to disable roudning even if `rounding` is specified. The rounding flags cam be combined to round any combination of corners. The following common combinations are defined for cenvenience: + +- **ImDrawFlags_RoundCornersTop**: round top left and right corners +- **ImDrawFlags_RoundCornersBottom**: round bottom left and right corners +- **ImDrawFlags_RoundCornersLeft**: round left top and bottom corners +- **ImDrawFlags_RoundCornersRight**: round right top and bottom corners + + +### Stroke Position + +These flags are used to position the stroke relative to the path of the shape. This makes it easier to create crisp pixel perfect renderings which scale well. These apply to all stroked shapes. + +**Inside is right of the path direction**. That is, if you draw clock wise closed shape, the inside will be visually inside the shape. + +- **ImDrawFlags_StrokeInside**: stroke is expanded right of the path. +- **ImDrawFlags_StrokeCenter**: stroke is expanded equally to both sides of the path. +- **ImDrawFlags_StrokeCenterAligned**: stroke is expanded to both sides, so that one side always has integer offset, odd sizes grow inside. This allows center like strokes which are pixel aligned. +- **ImDrawFlags_StrokeOutside**: stroke is expanded left of the path +- **ImDrawFlags_StrokeLegacy**: stroke position mimicks the old API behavior (may differ per function) + +### Default Stroke Position + +In order to keep the common use intuitive to use (and to help with the migration from pre 1.93 API), the default stroke position is different for the two groups of shapes. + +- **Primitives**: `AddLineH()`, `AddLineV()`, `AddRect()`, `AddQuad()`, `AddNGon()`, `AddTriangle()`, `AddCircle()`, `AddEllipse()`. +
The default stroke position is **StrokeInside**. + +- **Paths**: `AddLine()`, `AddBezierCubic()`, `AddBezierQuadratic()`, `AddPolyline()`, `PathStroke()`. +
The default stroke position is **StrokeCenter**. + +The Default Stroke Position may be overidden by passing one of the dedicated `ImDrawFlags` value to any function. + +![Stroke positions](drawlist/stroke_pos_all.svg) + +## Stroke Options +- **ImDrawFlags_Closed**: This option closes the path by drawing a line from first to last point. Applies to `AddPolyline()`and `PathStroke()` +- **ImDrawFlags_MiterOnly**: This option chooses a fast path in the rendering and skips logic that tried to handle very sharp corners. Can be used for well behaved shapes to speed up rendering. Applies to all stroked shapes. +- **ImDrawFlags_SquareCap**: Expands the ends of an open path so that they extend hand line thickess beyond the end points. Applies to `AddPolyline()`and `PathStroke()`. +- **ImDrawFlags_NoAAEnds**: Does not render anti-aliased ends for lines. This can speed up single line rendering, at the expense of aliasing and potentially missed pixels. Applies to `AddPolyline()`and `PathStroke()`. + +![Line flags](drawlist/line_flags.svg) + +![Miter Only](drawlist/miter_only.svg) + +# Draw List Flags (`ImDrawListFlags`) + +- **ImDrawListFlags_RoundCornersUseTex**: toggles whether to use texture to render small rounded rectangles (stroked and filled) using textured corners. +- **ImDrawListFlags_AntiAliasedLines**: is now unsupported, lines are always anti-aliased, except when calling `AddPolylineLegacy()` directly. +- **ImDrawListFlags_AntiAliasedLinesUseTex**: is now unsupported, lines always use texture for anti-alias. +- **ImDrawListFlags_AntiAliasedFill**: is now unsupported, fills are always anti-aliased, except when calling `AddConvexPolyFilledLegacy()` directly. + + +# API + +## `AddLine(p1, p2, col, thickness, flags)` + +![Line](drawlist/line_basics.svg) + +Draws line from **p1** to **p2** with specified color and thickness. Default thickness is **1.0**. Default storke positon **Center**. Stroke Position and Stroke Options flags can be used. + +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. + +
+Changes from versions < 1.93 + +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. + +After: **the default stroke position is Center. The 0.5px offset is now removed, so `AddLine()` works the same way as a path with 2 points. Uses of `AddLine()` should be audited and any compensation for the 0.5px offset can be removed.** + +There are two new functions `AddLineV()` and `AddLineH()` which should be used for drawing horizontal and vertical lines. Their default stroke position is Inside, which matched many uses of 1px lines draw using `AddLine()`. They have additional optimizations for the cases when you are drawing pixel perfect lines. + +When switching from legacy AddLine() values to `AddLineV()`/`AddLineH()` you can keep mostly same inputs coordinates add `AddLineV()`/`AddLineH()` default stroke position is Inside: + +- Before: `AddLine({x, y1}, {x, y2}, col)` --> use `AddLineV(x, y1, y2, col)` // Vertical line. +- Before: `AddLine({x1, y}, {x2, y}, col)` --> use `AddLineH(x1, x2, y, col)` // Horizontal line. + +If you have lines that form a continuous shape use the Path functions or `AddPolyline()` instead. They will handle the joins between the lines. They both support `ImDrawFlags_Closed` which will closes the shape by creating a segment automatically between first and last point. + +``` +AddLine({ 1,2 }, { 5,2 }) +``` + +**Before**: 0.5px offset, no AA line ends. The start pixel is covered due to the rasterization filling rules, and the end pixel is not for same reason. + +![Line 0](drawlist/line_0.svg) + +**After**: Offset is removed so the line is centered around the input coordinates. Existing uses will appear blurred since the only half of the pixels are covered. + +![Line 1](drawlist/line_1.svg) + +**FIXME: Missing a "after" AddLine() example that looks correct, even if also suggesting to use AddLineH().** + +``` +AddLine({ 1.5,2.5 }, { 5.5,2.5 }) +``` + +**After**: If we were to add the 0.5px offset back, then then the line would look crisp as before, but the line ends were blurred, since the line covers only half a pixel on each end. + +![Line 2](drawlist/line_2.svg) + + +``` +AddLineH( {1,5}, 2) +``` + +**Migration**: Horizontal and vertical lines are recommended to be replaced with `AddLineH()` and `AddLineV()`. Other use cases might require tweaking. Some use cases we've had to fix already compensated for the 0.5px offset, which can now be removed. Stroke position `ImDrawFlags_StrokeLegacy` can be used in cases which are deemed too tricky to fix, and old behavior should be used. + +![Line 3](drawlist/line_3.svg) + +
+ +## `AddLineH(min_x, max_x, y, col, thickness, flags)` + +![Line horizontal](drawlist/lineh_basics.svg) + +Draws horizontal line at **y** from **min_x** to **max_x** with specified color and thickness. Default thickness is **1.0**. Default stroke positon **Inside**. Stroke Position and Stroke Options flags can be used. Prefer to use this method over the generic `AddLine()` to draw horizontal lines. + +The "inside" of the shape below the line. You can think the horizontal line as the top edge of a rectangle. + +Optimized rendering is used, if the horizontal line is drawn on integer coordinates, integer thickness, and the stroke offset is Inside or Outside. + +
+Changes from versions < 1.93 + +`AddLineH()` used to be implemented similarly as `AddLine()` and had the same 0.5px offset and missing anti-aliased end caps. + +``` +AddLineH( {1,5}, 2) +``` + +**Before**: +0.5px offset, no AA line ends. The start pixel is covered due to the rasterization filling rules, and the end pixel is not for same reason. + +![LineH 0](drawlist/lineh_0.svg) + + +**After**: +The default stroke position for `AddLineH()` is **Inside**, which means that 1px lines will look the same as before, and thicker lines will grow below the specified line. + +![LineH 1](drawlist/lineh_1.svg) + +
+ +## `AddLineV(x, min_y, max_y, col, thickness, flags)` + +![Line vertical](drawlist/linev_basics.svg) + +Draws vertical line at **x** from **max_y** to **min_x** with specified color and thickness. Default thickness is **1.0**. Default stroke positon **Inside**. Stroke Position and Stroke Options flags can be used. Prefer to use this method over the generic `AddLine()` to draw vertical lines. + +The "inside" of the shape right of the line. You can think the vertical line as the left edge of a rectangle. + +Optimized rendering is used, if the vertical line is drawn on integer coordinates, integer thickness, and the stroke offset is Inside or Outside. + +
+Changes from versions < 1.93 + +`AddLineV()` used to have the same 0.5px offset as AddLine(). The offset was removed,. + +``` +AddLineV(2, {1,5}) +``` + +**Before**: +0.5px offset, no AA line ends +The start pixel is covered due to the rasterization filling rules, and the end pixel is not for same reason. + +![LineV 0](drawlist/linev_0.svg) + +**After**: +The default stroke position for `AddLineV()` is "inside", which means that 1px lines will look the same as before, and thicker lines will grow below the specified line. + +![LineV 1](drawlist/linev_1.svg) + +
+ +## `AddRect(p_min, p_max, col, rounding, thickness, flags)` + +![Rectangle](drawlist/rect_basics.svg) + +Draws stroked rectangle from **p_min** (top-left) to **p_max** ( bottom-right), with specified color, rounding and thickness. The default rounding is **0.0**, default thickness is **1.0**, and default stroke position is **Inside**. Corner Rounding and Stroke Position flags can be used. + +The rendering code now handles corners cases robustly, like stroke thickness that would completely cover the inside of the shape will fallback to rendering to filled rectangle instead. + +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. + +
+Changes from versions < 1.93 + +`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. + +As the offset was fixed, thicker lines would still render with that half pixel offset, but would not stay inside the shape unless parameters were fudged. + +The 0.5px offset is now removed, and the user can use the stroke position to place the stroke inside, center, outside of the shape, inside being the default. + +``` +AddRect({ 1,1 }, { 7,7 }, 1) +AddRect({ 2,2 }, { 6,6 }, 2) +``` + +**Before**: +Fixed 0.5px offset on all thickness. This resulted blurred lines on even thicknesses. + +![Rect 0](drawlist/rect_0.svg) ![Rect 1](drawlist/rect_1.svg) + +``` +AddRect({ 2,2 }, { 6,6 }, 2) +``` + +**Migration**: +By default, the stroke is placed inside the shape. +The uses of `AddRect()` that use 1px thickness will work as before. +Other uses of `AddRect()` should be reviewed to see if the intended use was to draw the stroke at center or inside of the shape. + +![Rect 2](drawlist/rect_2.svg) + +
+ +## `AddRectFilled(p_min, p_max, col, rounding, flags)` + +Draws filled rectangle from **p_min** (top-left) to **p_max** ( bottom-right), with specified color, rounding. The default rounding is **0.0**. Corner Rounding flags can be used. + +Optimized rendering is used when the coordinates are integer, and rounding is small integer. + +
+Changes from versions < 1.93 + +`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. + +``` +AddRectFilled({ 1,1 }, {7,4.5} ) +``` + +**Before**: +Non-rounded rectangles did not have anti-aliasing. + +![Rect Filled 0](drawlist/rect_filled_0.svg) + + +**After**: +Rectangles which are draw on non-integer coordinates are anti-aliased. + +![Rect Filled 1](drawlist/rect_filled_1.svg) + +
+ + +## `AddCircle(center, radius, col, num_segments, thickness, flags)` + +![Circle](drawlist/circle_basics.svg) + +Draws stroked circle at **center** using **radius**, with specified color and thickness. The default thickness is **1.0**, and default stroke position is **Inside**. Stroke Position flags can be used. + +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. + +
+Changes from versions < 1.93 + +`AddCircle()` used to have fixed 0.5px inset. This meant that a 1px line draw was drawn inside the shape. + +As the offset was fixed, thicker lines would still render with that half pixel offset, but would not stay inside the shape unless parameters were fudged. + +The 0.5px offset is now removed, and the user can use the stroke position to place the stroke inside, center, outside of the shape, inside being default. + +
+ +## `AddCircleFilled(center, radius, col, num_segments)` + +Draws filled circle at **center** using **radius**, with specified color. + + +## `AddNgon(center, radius, col, num_segments, thickness, flags)` + +![Regular polygon](drawlist/ngon_basics.svg) + +Draws stroked regular polygon centered at **center** with circumcircle **radius**, with specified color, segment count, and thickness. + +The default thickness is **1.0**, and default stroke position is **Inside**. Stroke Position flags can be used. + +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. + +
+Changes from versions < 1.93 + +`AddNGon()` used to have fixed 0.5px inset. This meant that a 1px line draw was drawn inside the shape. + +As the offset was fixed, thicker lines would still render with that half pixel offset, but would not stay inside the shape unless parameters were fudged. + +The 0.5px offset is now removed, and the user can use the stroke position to place the stroke inside, center, outside of the shape, inside being default. + +
+ + +## `AddNgonFilled(center, radius, col, num_segments)` + +Draws filled regular polygon at **center** using circumcircle **radius**, with specified color, and segment count. + + +## `AddEllipse(center, radius, col, rot, num_segments, thickness, flags)` + +![Ellipse](drawlist/ellipse_basics.svg) + +Draws stroked ellipse at **center** using **radius** (separate for x, y), with specified rotation, color, segment count and thickness. + +The default rotation is *0*, segment count is *0* (calculate count automatically based on radius), default thickness is **1.0**, and default stroke position is **Inside**. Stroke Position flags can be used. + +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. + +
+Changes from versions < 1.93 + +The ellipse used to have center stroke position, it is not changed inside to be consistent with other primitive shapes. + +The code did not have the 0.5px offset as other primitive drawing functions, so even 1px thick ellipses may appear smaller than before. + +To get the old behavior set stroke position to center. + +
+ +## `AddEllipseFilled(center, radius, col, rot, num_segments)` + +Draws filled ellipse at **center** using **radius** (separate for x, y), with specified rotation, color, and segment count. + +The default rotation is *0*, segment count is *0* (calculate count automatically based on radius). + +## `AddPolyline(points, num_points, col, thickness, flags)` + +![Polyline](drawlist/polyline_basics.svg) + +Draws stroked polyline described by **points** and **num_points**, with specified color, and thickness. Stroke Position and Stroke Options flags can be used. + +![Polyline 0](drawlist/polyline_0.svg) + +The stroke expansion uses corner miter calculation, which keeps thickness along the line segments consistent. If the corner becomes too sharp, it will be bevelled to avoid long spikes at corners. + +There are some robustness measures for the case where the line thickness is larger than the features being drawn to avoid long spikes in inner corners. Due to the chose algorithm, some rendering artifacts are possible when the path features are smaller than line thickness, but the artifacts should be localized. The implementation attempts to favor simple implementation and robustness over the corner case accuracy. + +The rendering uses textures for ant ialiasing for all line thicknesses. This allows to use just one rendering function, and rendering is as fast on all sizes. There’s max line thickness, 32 (`IM_DRAWLIST_TEX_LINES_WIDTH_MAX`), after which the lines will start to become blurry. + +### Stroke Options +![Line flags](drawlist/line_flags.svg) + +If drawing a closed shape, you can omit the last segment and use flag `ImDrawFlags_Closed`. This will also create correct line joins between the first and last segment. + +By default, the line ends are anti-aliased. This can be turned off with flag `ImDrawFlags_NoAAEnds` for slight performance increase. + +The line ends can have square caps using flag `ImDrawFlags_SquareCap`, which will extend the line by half thickness. This can help to render widgets at various sizes. + +![Miter Only](drawlist/miter_only.svg) + +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 skipeed, 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. + +### Stroke Position + +![Stroke positions](drawlist/stroke_pos.svg) + +To make it easier to define and reuse the geometry for shapes, and to render shapes pixel perfect, the stroke position can be set to be inside, center, center aligned, or outside of the polyline. + +For example, then the stroke position is inside, the stroke will be crips as long as the input coordinates and line thickness are integer. + +**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. + +
+Changes from versions < 1.93 + +The algorithm to render lines got overhauled. + +![Polyline 0](drawlist/polyline_0.svg) + +Previous the polyline rendering would expand the stroke along the normal at each polyline vertex. This caused inconsistent line width, which very noticeable when the polyline has sharper corners. + +The line ends are now anti-aliased. This solves missing pixels at line ends and results in cleaner rendering, especially under motion. + +
+ + +## `AddConvexPolyFilled(points, num_points, col)` + +Draws filled polygon described by **points** and **num_points**, with specified color. Stroke Options flags can be used. + +The polygon must be wound in clock wise order. + +The rendering expands small faded fringe around the polygon for anti-aliasing. To keep the expansion robust, the polygon rendering bevels really sharp corners, and clamps long miters in inner corners. As the fringe is 1px wide, it can cause issues when trying to render long thin polygons whose smallest extent is less than 1px. + +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. + +
+Changes from versions < 1.93 + +`PathFillConvex()` was improved to handle input geometry more robustly. + +The rendering of sharp corners was improved. Earlier there were issues with sharp corners either creating long spikes, or messing up the adjacent edge’s anti-aliasing. Now the anti-aliasing fringe calculation is more consistent, and sharp corners get bevelled to avoid spikes. + +
+ + +--- + +--- + +--- + + +### `AddConcavePolyFilled(points, num_points, col)` + + +### `AddQuad(p1, p2, p3, p4, col, thickness)` + +![Quad polygon](drawlist/quad_basics.svg) + +Works as before. Support for stroke position was added. Fixes and improvements to `AddPolyline()` also apply. + +### `AddQuadFilled(p1, p2, p3, p4, col)`
`AddTriangleFilled(p1, p2, p3, col)` + +Works as before. Fixes and improvements to `AddConvexPolyFilled()` for sharp corners also apply. + + +### `AddTriangle(p1, p2, p3, col, thickness)` + +![Triangle polygon](drawlist/triangle_basics.svg) + +Works as before. Support for stroke position was added. Fixes and improvements to `AddPolyline()` also apply. + +### `AddTriangleFilled(p1, p2, p3, col)`
`AddTriangleFilled(p1, p2, p3, col)` + +Works as before. Fixes and improvements to `AddConvexPolyFilled()` for sharp corners also apply. + + +### `AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments)` + +![Cubic Bezier](drawlist/bezier_cubic_basics.svg) + +Works as before. Support for stroke position was added. Fixes and improvements to `AddPolyline()` also apply. + + +### `AddBezierQuadratic(p1, p2, p3, col, thickness, num_segments)` + +![Quadratic Bezier](drawlist/bezier_quad_basics.svg) + +Works as before. Support for stroke position was added. Fixes and improvements to `AddPolyline()` also apply. + + + + +### `AddImageRounded(tex_ref, p_min, p_max, uv_min, uv_max, col, rounding, flags)` + +Works as before. + + +### `AddImage(tex_ref, p_min, p_max, uv_min, uv_max, col)` +### `AddImageQuad(tex_ref, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col)` +### `AddRectFilledMultiColor(p_min, p_max, col_upr_left, col_upr_right, col_bot_right, col_bot_left)` + +Works as before. Note: does not support anti-aliasing when non-integer coordinates are passed. + + +### `PathStroke(col, thickness, flags)` + +Works as before. Support for stroke position was added. Fixes and improvements to `AddPolyline()` also apply. + +### `PathFillConcave(col)` + +Works as before. + +### `PathFillConvex(col)` + +Works as before. The general improvements to `AddConvexPolyFilled()` apply to the convex filled path too. + + diff --git a/drawlist/bezier_cubic_basics.svg b/drawlist/bezier_cubic_basics.svg new file mode 100644 index 0000000..143731a --- /dev/null +++ b/drawlist/bezier_cubic_basics.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/drawlist/bezier_quad_basics.svg b/drawlist/bezier_quad_basics.svg new file mode 100644 index 0000000..67f7c45 --- /dev/null +++ b/drawlist/bezier_quad_basics.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/drawlist/circle_basics.svg b/drawlist/circle_basics.svg new file mode 100644 index 0000000..4a7c5d1 --- /dev/null +++ b/drawlist/circle_basics.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/drawlist/ellipse_basics.svg b/drawlist/ellipse_basics.svg new file mode 100644 index 0000000..30b8a9e --- /dev/null +++ b/drawlist/ellipse_basics.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/line_0.svg b/drawlist/line_0.svg new file mode 100644 index 0000000..f75e2a6 --- /dev/null +++ b/drawlist/line_0.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/line_1.svg b/drawlist/line_1.svg new file mode 100644 index 0000000..32a9bd6 --- /dev/null +++ b/drawlist/line_1.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/line_2.svg b/drawlist/line_2.svg new file mode 100644 index 0000000..576cad4 --- /dev/null +++ b/drawlist/line_2.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/line_3.svg b/drawlist/line_3.svg new file mode 100644 index 0000000..a917ffe --- /dev/null +++ b/drawlist/line_3.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/line_basics.svg b/drawlist/line_basics.svg new file mode 100644 index 0000000..550e7f5 --- /dev/null +++ b/drawlist/line_basics.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/drawlist/line_flags.svg b/drawlist/line_flags.svg new file mode 100644 index 0000000..ed99e25 --- /dev/null +++ b/drawlist/line_flags.svg @@ -0,0 +1,16 @@ + + + + + + +Normal +SquareCap +NoAAEnds + + + + + + + diff --git a/drawlist/lineh_0.svg b/drawlist/lineh_0.svg new file mode 100644 index 0000000..2ba79c1 --- /dev/null +++ b/drawlist/lineh_0.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/lineh_1.svg b/drawlist/lineh_1.svg new file mode 100644 index 0000000..9dd7dcc --- /dev/null +++ b/drawlist/lineh_1.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/lineh_basics.svg b/drawlist/lineh_basics.svg new file mode 100644 index 0000000..f85b486 --- /dev/null +++ b/drawlist/lineh_basics.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/drawlist/linev_0.svg b/drawlist/linev_0.svg new file mode 100644 index 0000000..a84a84a --- /dev/null +++ b/drawlist/linev_0.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/linev_1.svg b/drawlist/linev_1.svg new file mode 100644 index 0000000..c47adf8 --- /dev/null +++ b/drawlist/linev_1.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/linev_basics.svg b/drawlist/linev_basics.svg new file mode 100644 index 0000000..ee8bff0 --- /dev/null +++ b/drawlist/linev_basics.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/drawlist/miter_only.svg b/drawlist/miter_only.svg new file mode 100644 index 0000000..bccbea4 --- /dev/null +++ b/drawlist/miter_only.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +MiterOnly +Default + diff --git a/drawlist/ngon_basics.svg b/drawlist/ngon_basics.svg new file mode 100644 index 0000000..ac59509 --- /dev/null +++ b/drawlist/ngon_basics.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/drawlist/polyline_0.svg b/drawlist/polyline_0.svg new file mode 100644 index 0000000..86f6857 --- /dev/null +++ b/drawlist/polyline_0.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/polyline_basics.svg b/drawlist/polyline_basics.svg new file mode 100644 index 0000000..9394725 --- /dev/null +++ b/drawlist/polyline_basics.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/quad_basics.svg b/drawlist/quad_basics.svg new file mode 100644 index 0000000..d3cda79 --- /dev/null +++ b/drawlist/quad_basics.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/drawlist/rect_0.svg b/drawlist/rect_0.svg new file mode 100644 index 0000000..0b8240b --- /dev/null +++ b/drawlist/rect_0.svg @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/rect_1.svg b/drawlist/rect_1.svg new file mode 100644 index 0000000..f3d85d1 --- /dev/null +++ b/drawlist/rect_1.svg @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/rect_2.svg b/drawlist/rect_2.svg new file mode 100644 index 0000000..c861685 --- /dev/null +++ b/drawlist/rect_2.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/rect_basics.svg b/drawlist/rect_basics.svg new file mode 100644 index 0000000..fcb469b --- /dev/null +++ b/drawlist/rect_basics.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/drawlist/rect_filled_0.svg b/drawlist/rect_filled_0.svg new file mode 100644 index 0000000..51ec5e5 --- /dev/null +++ b/drawlist/rect_filled_0.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/rect_filled_1.svg b/drawlist/rect_filled_1.svg new file mode 100644 index 0000000..df472a1 --- /dev/null +++ b/drawlist/rect_filled_1.svg @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/stroke_pos.svg b/drawlist/stroke_pos.svg new file mode 100644 index 0000000..d977ac4 --- /dev/null +++ b/drawlist/stroke_pos.svg @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/stroke_pos_all.svg b/drawlist/stroke_pos_all.svg new file mode 100644 index 0000000..79ba2e5 --- /dev/null +++ b/drawlist/stroke_pos_all.svg @@ -0,0 +1,392 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +StrokeInside +StrokeOutside +StrokeCenter +StrokeCenterAligned +thickness = 1 +thickness = 2 +thickness = 3 +X +X +X +X +X +X +X +X +X +X +X +X +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drawlist/triangle_basics.svg b/drawlist/triangle_basics.svg new file mode 100644 index 0000000..8b45ff8 --- /dev/null +++ b/drawlist/triangle_basics.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + +