cranpose_ui/modifier/
weight.rs1use super::{Modifier, inspector_metadata};
2use crate::modifier_nodes::WeightElement;
3
4impl Modifier {
5 pub fn weight(self, weight: f32) -> Self {
9 self.weight_with_fill(weight, true)
10 }
11
12 pub fn weight_with_fill(self, weight: f32, fill: bool) -> Self {
14 let modifier = Self::with_element(WeightElement::new(weight, fill))
15 .with_inspector_metadata(inspector_metadata("weight", move |info| {
16 info.add_property("weight", weight.to_string());
17 info.add_property("fill", fill.to_string());
18 }));
19 self.then(modifier)
20 }
21
22 #[expect(non_snake_case)]
24 pub fn columnWeight(self, weight: f32, fill: bool) -> Self {
25 self.weight_with_fill(weight, fill)
26 }
27
28 #[expect(non_snake_case)]
30 pub fn rowWeight(self, weight: f32, fill: bool) -> Self {
31 self.weight_with_fill(weight, fill)
32 }
33}