egui/atomics/
sized_atom.rs

1use crate::SizedAtomKind;
2use emath::Vec2;
3
4/// A [`crate::Atom`] which has been sized.
5#[derive(Clone, Debug)]
6pub struct SizedAtom<'a> {
7    pub(crate) grow: bool,
8
9    /// The size of the atom.
10    ///
11    /// Used for placing this atom in [`crate::AtomLayout`], the cursor will advance by
12    /// size.x + gap.
13    pub size: Vec2,
14
15    /// Intrinsic size of the atom. This is used to calculate `Response::intrinsic_size`.
16    pub intrinsic_size: Vec2,
17
18    pub kind: SizedAtomKind<'a>,
19}
20
21impl SizedAtom<'_> {
22    /// Was this [`crate::Atom`] marked as `grow`?
23    pub fn is_grow(&self) -> bool {
24        self.grow
25    }
26}