egui/crates/egui_demo_lib/tests/snapshots/demos
Emil Ernerfeldt 3c07e01d08
Improve tessellation quality (#5669)
## Defining what `Rounding` is
This PR defines what `Rounding` means: it is the corner radius of
underlying `RectShape` rectangle. If you use `StrokeKind::Inside`, this
means the rounding is of the outer part of the stroke. Conversely, if
you use `StrokeKind::Outside`, the stroke is outside the rounded
rectangle, so the stroke has an inner radius or `rounding`, and an outer
radius that is larger by `stroke.width`.

This definitions is the same as Figma uses.

## Improving general shape rendering
The rendering of filled shapes (rectangles, circles, paths, bezier) has
been rewritten. Instead of first painting the fill with the stroke on
top, we now paint them as one single mesh with shared vertices at the
border. This has several benefits:

* Less work (faster and with fewer vertices produced)
* No overdraw (nicer rendering of translucent shapes)
* Correct blending of stroke and fill

The logic for rendering thin strokes has also been improved, so that the
width of a stroke of `StrokeKind::Outside` never affects the filled area
(this used to be wrong for thin strokes).

## Improving of rectangle rendering
Rectangles also has specific improvements in how thin rectangles are
painted.
The handling of "Blur width" is also a lot better, and now works for
rectangles with strokes.
There also used to be bugs with specific combinations of corner radius
and stroke width, that are now fixed.

##  But why?
With the new `egui::Scene` we end up with a lot of zoomed out shapes,
with sub-pixel strokes. These need to look good! One thing led to
another, and then I became obsessive 😅

## Tessellation Test
In order to investigate the rendering, I created a Tessellation Test in
the `egui_demo_lib`.

[Try it
here](https://egui-pr-preview.github.io/pr/5669-emilkimprove-tessellator)

![Screenshot 2025-02-04 at 08 45
50](https://github.com/user-attachments/assets/20b47a30-de6a-4ff5-885b-2e2fd6d88321)


![image](https://github.com/user-attachments/assets/e17c50eb-5ae7-48d4-bb0d-4f2165075897)
2025-02-04 11:30:12 +01:00
..
Bézier Curve.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Code Editor.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Code Example.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Context Menus.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Dancing Strings.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Drag and Drop.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Extra Viewport.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Font Book.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Frame.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Highlighting.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Interactive Container.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Misc Demos.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Modals.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Multi Touch.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Painting.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Pan Zoom.png Change `Harness::run` to run until no more repaints are requested (#5580) 2025-01-07 08:33:44 +01:00
Panels.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Scene.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Screenshot.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Scrolling.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Sliders.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Strip.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Table.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Text Layout.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
TextEdit.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Tooltips.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Undo Redo.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00
Window Options.png Improve tessellation quality (#5669) 2025-02-04 11:30:12 +01:00