28 releases (breaking)

0.27.2 Apr 2, 2024
0.27.1 Mar 29, 2024
0.26.2 Feb 14, 2024
0.24.1 Nov 30, 2023
0.10.0 Feb 28, 2021

#809 in GUI

Download history 15066/week @ 2023-12-23 19787/week @ 2023-12-30 26862/week @ 2024-01-06 29315/week @ 2024-01-13 29383/week @ 2024-01-20 26873/week @ 2024-01-27 30255/week @ 2024-02-03 32060/week @ 2024-02-10 33438/week @ 2024-02-17 31466/week @ 2024-02-24 33062/week @ 2024-03-02 35657/week @ 2024-03-09 31471/week @ 2024-03-16 36414/week @ 2024-03-23 35622/week @ 2024-03-30 28152/week @ 2024-04-06

135,985 downloads per month
Used in 625 crates (20 directly)

(MIT OR Apache-2…

1MB
11K 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 screeen 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–9MB
~62K SLoC