diff options
author | 2022-11-10 14:43:38 -0800 | |
---|---|---|
committer | 2022-11-10 15:25:54 -0800 | |
commit | 365f37a3ae10e7aff407b84050f77da10820866e (patch) | |
tree | 471643b7f81019ef9cb0328c6d5ac6f4c625c90e /graphics/src/triangle.rs | |
parent | 23299a555f8b7e908a6a14915307792a7cf97b9a (diff) | |
download | iced-365f37a3ae10e7aff407b84050f77da10820866e.tar.gz iced-365f37a3ae10e7aff407b84050f77da10820866e.tar.bz2 iced-365f37a3ae10e7aff407b84050f77da10820866e.zip |
Added conditional configurations for WASM target for gradients & storage buffers, since storage buffers are not supported on wgpu WASM target at the moment.
Diffstat (limited to '')
-rw-r--r-- | graphics/src/triangle.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/graphics/src/triangle.rs b/graphics/src/triangle.rs index 04ff6d21..8b41bfc4 100644 --- a/graphics/src/triangle.rs +++ b/graphics/src/triangle.rs @@ -1,5 +1,7 @@ //! Draw geometry using meshes of triangles. -use crate::{Color, Gradient}; +use crate::Color; +#[cfg(not(target_arch = "wasm32"))] +use crate::Gradient; use bytemuck::{Pod, Zeroable}; @@ -27,6 +29,7 @@ pub struct Vertex2D { pub enum Style { /// Fill a primitive with a solid color. Solid(Color), + #[cfg(not(target_arch = "wasm32"))] /// Fill a primitive with an interpolated color. Gradient(Gradient), } @@ -37,6 +40,7 @@ impl From<Color> for Style { } } +#[cfg(not(target_arch = "wasm32"))] impl From<Gradient> for Style { fn from(gradient: Gradient) -> Self { Self::Gradient(gradient) |