30 releases (breaking)

0.28.1 Jul 5, 2024
0.27.2 Apr 2, 2024
0.27.1 Mar 29, 2024
0.24.1 Nov 30, 2023
0.10.0 Feb 28, 2021

#759 in GUI

Download history 33535/week @ 2024-05-30 33595/week @ 2024-06-06 34589/week @ 2024-06-13 30134/week @ 2024-06-20 30617/week @ 2024-06-27 37625/week @ 2024-07-04 38722/week @ 2024-07-11 40575/week @ 2024-07-18 40647/week @ 2024-07-25 39826/week @ 2024-08-01 46096/week @ 2024-08-08 41700/week @ 2024-08-15 42573/week @ 2024-08-22 42042/week @ 2024-08-29 41121/week @ 2024-09-05 36128/week @ 2024-09-12

167,908 downloads per month
Used in 766 crates (20 directly)

(MIT OR Apache-2…

1MB
12K SLoC

epaint - egui paint library

Latest version Documentation unsafe forbidden MIT Apache

A bare-bones 2D graphics library for turning simple 2D shapes and text into textured triangles.

Made for egui.


lib.rs:

A simple 2D graphics library for turning simple 2D shapes and text into textured triangles.

Made for egui.

Create some Shape:s and pass them to tessellate_shapes to generate Mesh:es that you can then paint using some graphics API of your choice (e.g. OpenGL).

Coordinate system

The left-top corner of the screen is (0.0, 0.0), with X increasing to the right and Y increasing downwards.

epaint uses logical points as its coordinate system. Those related to physical pixels by the pixels_per_point scale factor. For example, a high-dpi screen can have pixels_per_point = 2.0, meaning there are two physical screen pixels for each logical point.

Angles are in radians, and are measured clockwise from the X-axis, which has angle=0.

Feature flags

Dependencies

~2–8MB
~65K SLoC