1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Rename corner_radius to rounding

Also update changelogs and clean up other aspects of
https://github.com/emilk/egui/pull/1206
This commit is contained in:
Emil Ernerfeldt
2022-02-05 18:13:46 +01:00
parent ace2ac00da
commit 9ed96155e9
26 changed files with 187 additions and 148 deletions

View File

@@ -46,23 +46,23 @@ impl Shadow {
}
}
pub fn tessellate(&self, rect: emath::Rect, corner_radius: impl Into<Rounding>) -> Mesh {
pub fn tessellate(&self, rect: emath::Rect, rounding: impl Into<Rounding>) -> Mesh {
// tessellator.clip_rect = clip_rect; // TODO: culling
let Self { extrusion, color } = *self;
let cr: Rounding = corner_radius.into();
let rounding: Rounding = rounding.into();
let half_ext = 0.5 * extrusion;
let ext_corner_radius = Rounding {
nw: cr.nw + half_ext,
ne: cr.ne + half_ext,
sw: cr.sw + half_ext,
se: cr.se + half_ext,
let ext_rounding = Rounding {
nw: rounding.nw + half_ext,
ne: rounding.ne + half_ext,
sw: rounding.sw + half_ext,
se: rounding.se + half_ext,
};
use crate::tessellator::*;
let rect = RectShape::filled(rect.expand(half_ext), ext_corner_radius, color);
let rect = RectShape::filled(rect.expand(half_ext), ext_rounding, color);
let mut tessellator = Tessellator::from_options(TessellationOptions {
aa_size: extrusion,
anti_alias: true,