mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-12-22 12:28:19 -06:00
aaa
This commit is contained in:
parent
bbc1d9f1ff
commit
7bfd12749b
|
@ -1,4 +1,4 @@
|
|||
use crate::rect::FillColor;
|
||||
use crate::rect::{Corners, FillColor};
|
||||
|
||||
pub mod point;
|
||||
pub mod layer;
|
||||
|
@ -20,10 +20,10 @@ pub struct Frame {
|
|||
layers: Vec<FrameLayer>
|
||||
}
|
||||
|
||||
impl<T: Into<FillColor>> From<T> for Frame {
|
||||
fn from(color: T) -> Self {
|
||||
impl<T: Into<RectLayer>> From<T> for Frame {
|
||||
fn from(layer: T) -> Self {
|
||||
let mut frame = Self::default();
|
||||
frame.add(RectLayer::from_color(color));
|
||||
frame.add(layer.into());
|
||||
frame
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,11 +20,17 @@ pub enum FrameLayer {
|
|||
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct RectLayer {
|
||||
color: FillColor,
|
||||
image: Option<ImageHandle>,
|
||||
top_left: FramePoint2d,
|
||||
bottom_right: FramePoint2d,
|
||||
corner_radius: Corners<f32>,
|
||||
pub color: FillColor,
|
||||
pub image: Option<ImageHandle>,
|
||||
pub top_left: FramePoint2d,
|
||||
pub bottom_right: FramePoint2d,
|
||||
pub corner_radius: Corners<f32>,
|
||||
}
|
||||
|
||||
impl<T: Into<FillColor>> From<T> for RectLayer {
|
||||
fn from(color: T) -> Self {
|
||||
Self::from_color(color)
|
||||
}
|
||||
}
|
||||
|
||||
impl RectLayer {
|
||||
|
@ -65,9 +71,9 @@ impl Default for RectLayer {
|
|||
Self {
|
||||
color: FillColor::default(),
|
||||
image: None,
|
||||
top_left: FramePoint2d::default(),
|
||||
bottom_right: FramePoint2d::default(),
|
||||
corner_radius: Corners::default(),
|
||||
top_left: FramePoint2d::TOP_LEFT,
|
||||
bottom_right: FramePoint2d::BOTTOM_RIGHT,
|
||||
corner_radius: Corners::all(0.),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue