Introduce Translate primitive in iced_wgpu

This commit is contained in:
Héctor Ramón Jiménez 2020-04-28 03:18:31 +02:00
parent 2381a9310c
commit 59b1e90661
10 changed files with 127 additions and 104 deletions

View file

@ -1,15 +1,20 @@
use crate::Primitive;
use std::sync::Arc;
#[derive(Debug)]
pub struct Geometry(Arc<Primitive>);
#[derive(Debug, Clone)]
pub struct Geometry(Primitive);
impl Geometry {
pub(crate) fn from_primitive(primitive: Arc<Primitive>) -> Self {
pub(crate) fn from_primitive(primitive: Primitive) -> Self {
Self(primitive)
}
pub(crate) fn into_primitive(self) -> Arc<Primitive> {
pub fn into_primitive(self) -> Primitive {
self.0
}
}
impl From<Geometry> for Primitive {
fn from(geometry: Geometry) -> Primitive {
geometry.0
}
}