diff options
author | 2024-04-09 22:25:16 +0200 | |
---|---|---|
committer | 2024-04-09 22:25:16 +0200 | |
commit | 6ad5bb3597f640ac329801adf735d633bf0a512f (patch) | |
tree | f0928edacd09d6537878d22b00ad7ed7829c9ac0 /tiny_skia/src/primitive.rs | |
parent | 2c6fd9ac14c5d270e05b97b7a7fab811d25834c4 (diff) | |
download | iced-6ad5bb3597f640ac329801adf735d633bf0a512f.tar.gz iced-6ad5bb3597f640ac329801adf735d633bf0a512f.tar.bz2 iced-6ad5bb3597f640ac329801adf735d633bf0a512f.zip |
Port `iced_tiny_skia` to new layering architecture
Diffstat (limited to 'tiny_skia/src/primitive.rs')
-rw-r--r-- | tiny_skia/src/primitive.rs | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/tiny_skia/src/primitive.rs b/tiny_skia/src/primitive.rs index b7c428e4..5305788d 100644 --- a/tiny_skia/src/primitive.rs +++ b/tiny_skia/src/primitive.rs @@ -1,10 +1,5 @@ -use crate::core::Rectangle; -use crate::graphics::{Damage, Mesh}; - -pub type Primitive = crate::graphics::Primitive<Custom>; - #[derive(Debug, Clone, PartialEq)] -pub enum Custom { +pub enum Primitive { /// A path filled with some paint. Fill { /// The path to fill. @@ -24,29 +19,3 @@ pub enum Custom { stroke: tiny_skia::Stroke, }, } - -impl Damage for Custom { - fn bounds(&self) -> Rectangle { - match self { - Self::Fill { path, .. } | Self::Stroke { path, .. } => { - let bounds = path.bounds(); - - Rectangle { - x: bounds.x(), - y: bounds.y(), - width: bounds.width(), - height: bounds.height(), - } - .expand(1.0) - } - } - } -} - -impl TryFrom<Mesh> for Custom { - type Error = &'static str; - - fn try_from(_mesh: Mesh) -> Result<Self, Self::Error> { - Err("unsupported") - } -} |