Implement Canvas support for iced_tiny_skia
This commit is contained in:
parent
3f6e28fa9b
commit
5fd5d1cdf8
65 changed files with 1354 additions and 570 deletions
24
wgpu/src/widget/canvas/geometry.rs
Normal file
24
wgpu/src/widget/canvas/geometry.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
use crate::Primitive;
|
||||
|
||||
/// A bunch of shapes that can be drawn.
|
||||
///
|
||||
/// [`Geometry`] can be easily generated with a [`Frame`] or stored in a
|
||||
/// [`Cache`].
|
||||
///
|
||||
/// [`Frame`]: crate::widget::canvas::Frame
|
||||
/// [`Cache`]: crate::widget::canvas::Cache
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Geometry(Primitive);
|
||||
|
||||
impl Geometry {
|
||||
pub(crate) fn from_primitive(primitive: Primitive) -> Self {
|
||||
Self(primitive)
|
||||
}
|
||||
|
||||
/// Turns the [`Geometry`] into a [`Primitive`].
|
||||
///
|
||||
/// This can be useful if you are building a custom widget.
|
||||
pub fn into_primitive(self) -> Primitive {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue