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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user