Skip to main content

nominal_api_conjure/conjure/objects/scout/layout/api/
node_dimension.rs

1/// Dimension of a node in pixels.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    conjure_object::private::DeriveWith,
8    Copy
9)]
10#[serde(crate = "conjure_object::serde")]
11#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
12#[conjure_object::private::staged_builder::staged_builder]
13#[builder(crate = conjure_object::private::staged_builder, update, inline)]
14pub struct NodeDimension {
15    #[serde(rename = "width")]
16    #[derive_with(with = conjure_object::private::DoubleWrapper)]
17    width: f64,
18    #[serde(rename = "height")]
19    #[derive_with(with = conjure_object::private::DoubleWrapper)]
20    height: f64,
21}
22impl NodeDimension {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(width: f64, height: f64) -> Self {
26        Self::builder().width(width).height(height).build()
27    }
28    #[inline]
29    pub fn width(&self) -> f64 {
30        self.width
31    }
32    #[inline]
33    pub fn height(&self) -> f64 {
34        self.height
35    }
36}