rive_rs/animation/
transition_double_condition.rs

1// Copyright 2021 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use crate::animation::TransitionValueCondition;
6use crate::core::{Core, ObjectRef, OnAdded, Property};
7
8#[derive(Debug, Default)]
9pub struct TransitionDoubleCondition {
10    transition_double_condition: TransitionValueCondition,
11    value: Property<f32>,
12}
13
14impl ObjectRef<'_, TransitionDoubleCondition> {
15    pub fn value(&self) -> f32 {
16        self.value.get()
17    }
18
19    pub fn set_value(&self, value: f32) {
20        self.value.set(value);
21    }
22}
23
24impl Core for TransitionDoubleCondition {
25    parent_types![(transition_double_condition, TransitionValueCondition)];
26
27    properties![(157, value, set_value), transition_double_condition];
28}
29
30impl OnAdded for ObjectRef<'_, TransitionDoubleCondition> {
31    on_added!(TransitionValueCondition);
32}