From d4cc8c775d4c579aeac69ca2d212a604c67043b0 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 10 Oct 2021 20:26:58 +0200 Subject: Move paint and colors into `geom` --- src/layout/frame.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/layout') diff --git a/src/layout/frame.rs b/src/layout/frame.rs index c74f2abd..0e986fe4 100644 --- a/src/layout/frame.rs +++ b/src/layout/frame.rs @@ -4,9 +4,8 @@ use std::rc::Rc; use serde::{Deserialize, Serialize}; use super::{Constrained, Constraints}; -use crate::color::Color; use crate::font::FaceId; -use crate::geom::{Em, Length, Path, Point, Size}; +use crate::geom::{Em, Length, Paint, Path, Point, Size}; use crate::image::ImageId; /// A finished layout with elements at fixed positions. @@ -36,7 +35,7 @@ pub enum Element { /// Shaped text. Text(Text), /// A geometric shape and the paint which with it should be filled or - /// stroked. + /// stroked (which one depends on the kind of geometry). Geometry(Geometry, Paint), /// A raster image. Image(ImageId, Size), @@ -83,13 +82,6 @@ pub enum Geometry { Path(Path), } -/// How a fill or stroke should be painted. -#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] -pub enum Paint { - /// A solid color. - Color(Color), -} - impl Frame { /// Create a new, empty frame. #[track_caller] -- cgit v1.2.3