mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-23 19:38:27 +00:00
window_draw_list: Use c_char instead of i8
Target expects a c_char, which happens to be an i8 on x86, but it may be something else on other platforms (e.g. u8 on ARM).
This commit is contained in:
parent
485c8a230e
commit
9b0804f6be
@ -216,10 +216,12 @@ impl<'ui> WindowDrawList<'ui> {
|
|||||||
C: Into<ImColor>,
|
C: Into<ImColor>,
|
||||||
T: AsRef<str>,
|
T: AsRef<str>,
|
||||||
{
|
{
|
||||||
|
use std::os::raw::c_char;
|
||||||
|
|
||||||
let text = text.as_ref();
|
let text = text.as_ref();
|
||||||
unsafe {
|
unsafe {
|
||||||
let start = text.as_ptr() as *const i8;
|
let start = text.as_ptr() as *const c_char;
|
||||||
let end = (start as usize + text.len()) as *const i8;
|
let end = (start as usize + text.len()) as *const c_char;
|
||||||
sys::ImDrawList_AddText(self.draw_list, pos.into(), col.into().into(), start, end)
|
sys::ImDrawList_AddText(self.draw_list, pos.into(), col.into().into(), start, end)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user