ferroui_base/media/background_sizing.rs
1/// Defines how a background is drawn relative to its border.
2#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
3#[repr(i32)]
4pub enum BackgroundSizing {
5 /// The background is drawn up to the inside edge of the border.
6 ///
7 /// The background will never be drawn under the border itself and will not be visible
8 /// underneath the border regardless of border transparency.
9 #[default]
10 InnerBorderEdge = 0,
11
12 /// The background is drawn completely to the outside edge of the border.
13 ///
14 /// The background will be visible underneath the border if the border has transparency.
15 OuterBorderEdge = 1,
16
17 /// The background is drawn to the midpoint (center) of the border.
18 ///
19 /// The background will be visible underneath half of the border if the border has
20 /// transparency. For this reason it is not recommended to use
21 /// [`CenterBorder`](Self::CenterBorder) if transparency is involved.
22 ///
23 /// This value does not exist in other XAML frameworks and only exists for backwards
24 /// compatibility with legacy code. Before [`BackgroundSizing`] was added, rendering always
25 /// used this value (Skia's default).
26 CenterBorder = 2,
27}