mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-22 19:08:37 +00:00
Use igTextUnformatted in Ui::text
We already have a slice so this is faster.
This commit is contained in:
parent
63ceb71d44
commit
b31f649c19
@ -469,9 +469,11 @@ impl<'ui> Ui<'ui> {
|
|||||||
// Widgets
|
// Widgets
|
||||||
impl<'ui> Ui<'ui> {
|
impl<'ui> Ui<'ui> {
|
||||||
pub fn text<P: AsRef<ImStr>>(&self, text: P) {
|
pub fn text<P: AsRef<ImStr>>(&self, text: P) {
|
||||||
// TODO: use igTextUnformatted
|
let s = text.as_ref();
|
||||||
unsafe {
|
unsafe {
|
||||||
imgui_sys::igText(fmt_ptr(), text.as_ref().as_ptr());
|
let start = s.as_ptr();
|
||||||
|
let end = start.offset(s.len() as isize);
|
||||||
|
imgui_sys::igTextUnformatted(start as *const c_char, end as *const c_char);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn text_colored<'p, A>(&self, col: A, text: &'p ImStr)
|
pub fn text_colored<'p, A>(&self, col: A, text: &'p ImStr)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user