1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use crate::sys;
use crate::Ui;

/// # Content region
impl<'ui> Ui<'ui> {
    /// Returns the current content boundaries (in *window coordinates*)
    pub fn content_region_max(&self) -> [f32; 2] {
        let mut out = sys::ImVec2::zero();
        unsafe { sys::igGetContentRegionMax(&mut out) };
        out.into()
    }
    /// Equal to `ui.content_region_max()` - `ui.cursor_pos()`
    pub fn content_region_avail(&self) -> [f32; 2] {
        let mut out = sys::ImVec2::zero();
        unsafe { sys::igGetContentRegionAvail(&mut out) };
        out.into()
    }
    /// Content boundaries min (in *window coordinates*).
    ///
    /// Roughly equal to [0.0, 0.0] - scroll.
    pub fn window_content_region_min(&self) -> [f32; 2] {
        let mut out = sys::ImVec2::zero();
        unsafe { sys::igGetWindowContentRegionMin(&mut out) };
        out.into()
    }
    /// Content boundaries max (in *window coordinates*).
    ///
    /// Roughly equal to [0.0, 0.0] + size - scroll.
    pub fn window_content_region_max(&self) -> [f32; 2] {
        let mut out = sys::ImVec2::zero();
        unsafe { sys::igGetWindowContentRegionMax(&mut out) };
        out.into()
    }
    pub fn window_content_region_width(&self) -> f32 {
        unsafe { sys::igGetWindowContentRegionWidth() }
    }
}