🎉 Render wasm blur support

This commit is contained in:
Alejandro Alonso 2025-01-09 13:51:12 +01:00
parent d500058aa9
commit 7cc33b1a1a
8 changed files with 117 additions and 11 deletions

View file

@ -4,6 +4,7 @@ use uuid::Uuid;
use crate::render::{BlendMode, Renderable};
mod blurs;
mod bools;
mod fills;
mod images;
@ -12,6 +13,7 @@ mod paths;
mod renderable;
mod strokes;
pub use blurs::*;
pub use bools::*;
pub use fills::*;
pub use images::*;
@ -42,6 +44,7 @@ pub struct Shape {
fills: Vec<Fill>,
strokes: Vec<Stroke>,
blend_mode: BlendMode,
blur: Blur,
opacity: f32,
hidden: bool,
}
@ -61,6 +64,7 @@ impl Shape {
blend_mode: BlendMode::default(),
opacity: 1.,
hidden: false,
blur: Blur::default(),
}
}
@ -105,6 +109,10 @@ impl Shape {
self.hidden = value;
}
pub fn set_blur(&mut self, blur_type: u8, hidden: bool, value: f32) {
self.blur = Blur::new(blur_type, hidden, value);
}
pub fn add_child(&mut self, id: Uuid) {
self.children.push(id);
}