mirror of
https://github.com/penpot/penpot.git
synced 2026-05-17 14:03:42 +00:00
* ♻️ Move shape type serialization to wasm module * ♻️ Refactor serialization of constraints and vertical alignment into wasm module * ♻️ Refactor serialization and model of shape blur * ♻️ Refactor bool serialization to the wasm module * ♻️ Split wasm::layout into submodules * ♻️ Refactor serialization of AlignItems, AlignContent, JustifyItems and JustifyContent * ♻️ Refactor serialization of WrapType and FlexDirection * ♻️ Refactor serialization of JustifySelf * ♻️ Refactor serialization of GridCell * ♻️ Refactor serialization of AlignSelf * 🐛 Fix AlignSelf not being serialized * ♻️ Refactor handling of None variants in Raw* enums * ♻️ Refactor serialization of grid direction * ♻️ Refactor serialization of GridTrack and GridTrackType * ♻️ Refactor serialization of Sizing * ♻️ Refactor serialization of ShadowStyle * ♻️ Refactor serialization of StrokeCap and StrokeStyle * ♻️ Refactor serialization of BlendMode * ♻️ Refactor serialization of FontStyle * ♻️ Refactor serialization of GrowType
26 lines
477 B
Rust
26 lines
477 B
Rust
#[derive(Debug, Clone, Copy, PartialEq)]
|
|
pub enum BlurType {
|
|
LayerBlur,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
|
pub struct Blur {
|
|
pub hidden: bool,
|
|
pub blur_type: BlurType,
|
|
pub value: f32,
|
|
}
|
|
|
|
impl Blur {
|
|
pub fn new(blur_type: BlurType, hidden: bool, value: f32) -> Self {
|
|
Blur {
|
|
blur_type,
|
|
hidden,
|
|
value,
|
|
}
|
|
}
|
|
|
|
pub fn scale_content(&mut self, value: f32) {
|
|
self.value *= value;
|
|
}
|
|
}
|