From 1a1fe3bad5fc22d02c35ad7da0a879628aba8b3d Mon Sep 17 00:00:00 2001 From: Malik Olivier Boussejra Date: Fri, 13 Apr 2018 14:27:22 +0000 Subject: [PATCH] Wrap get_text_line_height_with_spacing && get_item_rect_size --- src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 33ca86c..418b3c3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -953,6 +953,19 @@ impl<'ui> Ui<'ui> { } } +impl<'ui> Ui<'ui> { + /// Get height of a line of previously drawn text item + pub fn get_text_line_height_with_spacing(&self) -> f32 { + unsafe { sys::igGetTextLineHeightWithSpacing() } + } + /// Get previously drawn item's size + pub fn get_item_rect_size(&self) -> (f32, f32) { + let mut out = ImVec2::new(0.0, 0.0); + unsafe { sys::igGetItemRectSize(&mut out); } + (out.x, out.y) + } +} + impl<'ui> Ui<'ui> { /// Creates a progress bar. Fraction is the progress level with 0.0 = 0% and 1.0 = 100%. ///