From 738a9c978ea0cec1640d5e3d864b5e9b00bc0164 Mon Sep 17 00:00:00 2001 From: Malik Olivier Boussejra Date: Thu, 29 Mar 2018 14:21:12 +0900 Subject: [PATCH] ui: Wrap get_content_region_avail --- src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 5b0f224..82dfb1d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -537,6 +537,16 @@ impl<'ui> Ui<'ui> { pub fn set_cursor_pos>(&self, pos: P) { unsafe { sys::igSetCursorPos(pos.into()) } } + + /// Get available space left between the cursor and the edges of the current + /// window. + pub fn get_content_region_avail(&self) -> (f32, f32) { + let mut out = ImVec2::new(0.0, 0.0); + unsafe { + sys::igGetContentRegionAvail(&mut out); + } + (out.x, out.y) + } } // ID scopes