mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-23 19:38:27 +00:00
typo fixed ofset -> offset
stride parameter removed from struct values_offset type updated to usize
This commit is contained in:
parent
0119c50169
commit
2f2fc759c2
@ -7,12 +7,11 @@ use libc::c_float;
|
|||||||
pub struct PlotLines<'p> {
|
pub struct PlotLines<'p> {
|
||||||
label: ImStr<'p>,
|
label: ImStr<'p>,
|
||||||
values: &'p [f32],
|
values: &'p [f32],
|
||||||
values_ofset: i32,
|
values_offset: usize,
|
||||||
overlay_text: Option<ImStr<'p>>,
|
overlay_text: Option<ImStr<'p>>,
|
||||||
scale_min: f32,
|
scale_min: f32,
|
||||||
scale_max: f32,
|
scale_max: f32,
|
||||||
graph_size: ImVec2,
|
graph_size: ImVec2,
|
||||||
stride: i32,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'p> PlotLines<'p> {
|
impl<'p> PlotLines<'p> {
|
||||||
@ -20,18 +19,17 @@ impl<'p> PlotLines<'p> {
|
|||||||
PlotLines {
|
PlotLines {
|
||||||
label: label,
|
label: label,
|
||||||
values: values,
|
values: values,
|
||||||
values_ofset: 0i32,
|
values_offset: 0usize,
|
||||||
overlay_text: None,
|
overlay_text: None,
|
||||||
scale_min: f32::MAX,
|
scale_min: f32::MAX,
|
||||||
scale_max: f32::MAX,
|
scale_max: f32::MAX,
|
||||||
graph_size: ImVec2::new(0.0f32, 0.0f32),
|
graph_size: ImVec2::new(0.0f32, 0.0f32),
|
||||||
stride: mem::size_of::<f32>() as i32,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn values_ofset(self, values_ofset: i32) -> Self {
|
pub fn values_offset(self, values_offset: usize) -> Self {
|
||||||
PlotLines { values_ofset: values_ofset, ..self }
|
PlotLines { values_offset: values_offset, ..self }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -54,22 +52,17 @@ impl<'p> PlotLines<'p> {
|
|||||||
PlotLines { graph_size: graph_size, ..self }
|
PlotLines { graph_size: graph_size, ..self }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn stride(self, stride: i32) -> Self {
|
|
||||||
PlotLines { stride: stride, ..self }
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn build(self) {
|
pub fn build(self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
imgui_sys::igPlotLines(self.label.as_ptr(),
|
imgui_sys::igPlotLines(self.label.as_ptr(),
|
||||||
self.values.as_ptr() as *const c_float,
|
self.values.as_ptr() as *const c_float,
|
||||||
self.values.len() as i32,
|
self.values.len() as i32,
|
||||||
self.values_ofset,
|
self.values_offset as i32,
|
||||||
self.overlay_text.map(|x| x.as_ptr()).unwrap_or(ptr::null()),
|
self.overlay_text.map(|x| x.as_ptr()).unwrap_or(ptr::null()),
|
||||||
self.scale_min,
|
self.scale_min,
|
||||||
self.scale_max,
|
self.scale_max,
|
||||||
self.graph_size,
|
self.graph_size,
|
||||||
self.stride);
|
mem::size_of::<f32>() as i32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user