// Copyright 2024 the Velato Authors // SPDX-License-Identifier: Apache-2.0 OR MIT use crate::schema::animated_properties::animated_property::{AnimatedProperty, AnimatedPropertyK}; use crate::schema::animated_properties::multi_dimensional::MultiDimensional; use crate::schema::animated_properties::position::Position; use crate::schema::animated_properties::value::FloatValue; use crate::schema::helpers::int_boolean::BoolInt; use crate::schema::{self}; use std::sync::LazyLock; pub static FLOAT_VALUE_ZERO: LazyLock = LazyLock::new(|| FloatValue { animated_property: AnimatedProperty { property_index: None, animated: Some(BoolInt::False), expression: None, slot_id: None, value: AnimatedPropertyK::Static(0.0), }, }); pub static FLOAT_VALUE_ONE_HUNDRED: LazyLock = LazyLock::new(|| FloatValue { animated_property: AnimatedProperty { property_index: None, animated: Some(BoolInt::False), expression: None, slot_id: None, value: AnimatedPropertyK::Static(100.0), }, }); // FORK tawasuyu: era `MULTIDIM_ONE` con `[1.0, 1.0, 1.0]`, y es el default de // la ESCALA de un transform — que en Lottie se expresa en **porcentaje** // (`animated.rs:75` divide por 100 antes de armar la `Affine`). O sea que un // transform sin campo `s` —que el schema de Lottie permite, con default 100— // se importaba al **1 %**: la capa entera colapsaba a un punto de cuatro // píxeles y el archivo no daba ningún error. Medido: la misma figura da 4 px // sin `s` y 8.100 con `s:[100,100]`. El nombre viejo era la mitad del engaño // («one» suena a escala unitaria, y unitaria es 100). Único consumidor: los // dos defaults de escala de `converters.rs`. pub static MULTIDIM_ONE_HUNDRED: LazyLock = LazyLock::new(|| MultiDimensional { animated_property: AnimatedProperty { property_index: None, animated: Some(BoolInt::False), expression: None, slot_id: None, value: AnimatedPropertyK::Static(vec![100.0, 100.0, 100.0]), }, length: None, }); pub static POSITION_ZERO: LazyLock = LazyLock::new(|| Position { property_index: None, animated: Some(BoolInt::False), expression: None, length: None, value: schema::animated_properties::position::PositionValueK::Static(vec![0.0, 0.0]), });