mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Refactor TessellationOptions to expose slider for feathering size (#1408)
The epaint tessellator uses "feathering" to accomplish anti-aliasing. This PS allows you to control the feathering size, i.e. how blurry the edges of epaint shapes are. This changes the interface of Tessellator slightly, and renames some options in TessellationOptions.
This commit is contained in:
@@ -599,10 +599,8 @@ fn add_hline(point_scale: PointScale, [start, stop]: [Pos2; 2], stroke: Stroke,
|
||||
if antialiased {
|
||||
let mut path = crate::tessellator::Path::default(); // TODO: reuse this to avoid re-allocations.
|
||||
path.add_line_segment([start, stop]);
|
||||
let options = crate::tessellator::TessellationOptions::from_pixels_per_point(
|
||||
point_scale.pixels_per_point(),
|
||||
);
|
||||
path.stroke_open(stroke, &options, mesh);
|
||||
let feathering = 1.0 / point_scale.pixels_per_point();
|
||||
path.stroke_open(feathering, stroke, mesh);
|
||||
} else {
|
||||
// Thin lines often lost, so this is a bad idea
|
||||
|
||||
|
||||
Reference in New Issue
Block a user