diff options
author | 2023-05-23 12:26:16 +0200 | |
---|---|---|
committer | 2023-05-23 14:50:29 +0200 | |
commit | 1c86defab5f5491b5f6b6e45faabf1b91ed195a3 (patch) | |
tree | ed8059727e8d3b1845b98b4e66af5d37116efd5d /core/src/renderer.rs | |
parent | 8300d86c242aa3147ec97b2820f774048c285ae8 (diff) | |
download | iced-1c86defab5f5491b5f6b6e45faabf1b91ed195a3.tar.gz iced-1c86defab5f5491b5f6b6e45faabf1b91ed195a3.tar.bz2 iced-1c86defab5f5491b5f6b6e45faabf1b91ed195a3.zip |
Extend border radius on relevant widgets
Diffstat (limited to 'core/src/renderer.rs')
-rw-r--r-- | core/src/renderer.rs | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/core/src/renderer.rs b/core/src/renderer.rs index 007a0370..7c73d2e4 100644 --- a/core/src/renderer.rs +++ b/core/src/renderer.rs @@ -6,7 +6,7 @@ mod null; pub use null::Null; use crate::layout; -use crate::{Background, Color, Element, Rectangle, Vector}; +use crate::{Background, BorderRadius, Color, Element, Rectangle, Vector}; /// A component that can be used by widgets to draw themselves on a screen. pub trait Renderer: Sized { @@ -60,29 +60,6 @@ pub struct Quad { pub border_color: Color, } -/// The border radii for the corners of a graphics primitive in the order: -/// top-left, top-right, bottom-right, bottom-left. -#[derive(Debug, Clone, Copy, PartialEq, Default)] -pub struct BorderRadius([f32; 4]); - -impl From<f32> for BorderRadius { - fn from(w: f32) -> Self { - Self([w; 4]) - } -} - -impl From<[f32; 4]> for BorderRadius { - fn from(radi: [f32; 4]) -> Self { - Self(radi) - } -} - -impl From<BorderRadius> for [f32; 4] { - fn from(radi: BorderRadius) -> Self { - radi.0 - } -} - /// The styling attributes of a [`Renderer`]. #[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { |