Merge pull request #185 from agersant/content-region

Content region
This commit is contained in:
Joonas Javanainen 2018-12-16 21:24:25 +02:00 committed by GitHub
commit 490ffe056d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -613,6 +613,16 @@ impl<'ui> Ui<'ui> {
let size = unsafe { sys::igGetWindowPos_nonUDT2() };
size.into()
}
pub fn get_window_content_region_min(&self) -> (f32, f32) {
let size = unsafe { sys::igGetWindowContentRegionMin_nonUDT2() };
size.into()
}
pub fn get_window_content_region_max(&self) -> (f32, f32) {
let size = unsafe { sys::igGetWindowContentRegionMax_nonUDT2() };
size.into()
}
}
// Layout
@ -718,6 +728,11 @@ impl<'ui> Ui<'ui> {
unsafe { sys::igSetCursorPos(pos.into()) }
}
pub fn get_content_region_max(&self) -> (f32, f32) {
let size = unsafe { sys::igGetContentRegionMax_nonUDT2() };
size.into()
}
/// Get available space left between the cursor and the edges of the current
/// window.
pub fn get_content_region_avail(&self) -> (f32, f32) {