tawasuyu

tawasuyu/llimphi

Sovereign retained-mode GPU UI framework in Rust (wgpu+vello+taffy+parley), Elm loop, 40+ widgets.

Rust 614Markdown 274TOML 149RON 310606 Sutichaykuna

⎇ main shared/foreign-lottie/src/import/defaults.rs Rust · 58 siq'ikuna · 2.3 KB Ñawpa willay Pi imata llamkarqan ch'uya

chore: refresco desde el monorepo (pin tawasuyu.git v0.3.0) b575c63f1 · Sergio ·

1// Copyright 2024 the Velato Authors
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3
4use crate::schema::animated_properties::animated_property::{AnimatedProperty, AnimatedPropertyK};
5use crate::schema::animated_properties::multi_dimensional::MultiDimensional;
6use crate::schema::animated_properties::position::Position;
7use crate::schema::animated_properties::value::FloatValue;
8use crate::schema::helpers::int_boolean::BoolInt;
9use crate::schema::{self};
10use std::sync::LazyLock;
11
12pub static FLOAT_VALUE_ZERO: LazyLock<FloatValue> = LazyLock::new(|| FloatValue {
13    animated_property: AnimatedProperty {
14        property_index: None,
15        animated: Some(BoolInt::False),
16        expression: None,
17        slot_id: None,
18        value: AnimatedPropertyK::Static(0.0),
19    },
20});
21
22pub static FLOAT_VALUE_ONE_HUNDRED: LazyLock<FloatValue> = LazyLock::new(|| FloatValue {
23    animated_property: AnimatedProperty {
24        property_index: None,
25        animated: Some(BoolInt::False),
26        expression: None,
27        slot_id: None,
28        value: AnimatedPropertyK::Static(100.0),
29    },
30});
31
32// FORK tawasuyu: era `MULTIDIM_ONE` con `[1.0, 1.0, 1.0]`, y es el default de
33// la ESCALA de un transform — que en Lottie se expresa en **porcentaje**
34// (`animated.rs:75` divide por 100 antes de armar la `Affine`). O sea que un
35// transform sin campo `s` —que el schema de Lottie permite, con default 100—
36// se importaba al **1 %**: la capa entera colapsaba a un punto de cuatro
37// píxeles y el archivo no daba ningún error. Medido: la misma figura da 4 px
38// sin `s` y 8.100 con `s:[100,100]`. El nombre viejo era la mitad del engaño
39// («one» suena a escala unitaria, y unitaria es 100). Único consumidor: los
40// dos defaults de escala de `converters.rs`.
41pub static MULTIDIM_ONE_HUNDRED: LazyLock<MultiDimensional> = LazyLock::new(|| MultiDimensional {
42    animated_property: AnimatedProperty {
43        property_index: None,
44        animated: Some(BoolInt::False),
45        expression: None,
46        slot_id: None,
47        value: AnimatedPropertyK::Static(vec![100.0, 100.0, 100.0]),
48    },
49    length: None,
50});
51
52pub static POSITION_ZERO: LazyLock<Position> = LazyLock::new(|| Position {
53    property_index: None,
54    animated: Some(BoolInt::False),
55    expression: None,
56    length: None,
57    value: schema::animated_properties::position::PositionValueK::Static(vec![0.0, 0.0]),
58});