Add infinite lines.
This commit is contained in:
parent
fa23f04fae
commit
ed1670604e
1 changed files with 15 additions and 0 deletions
15
src/lines.rs
15
src/lines.rs
|
@ -1,3 +1,5 @@
|
||||||
|
use sys::ImPlotInfLinesFlags__ImPlotInfLinesFlags_Horizontal;
|
||||||
|
|
||||||
use crate::sys;
|
use crate::sys;
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
use std::os::raw::c_char;
|
use std::os::raw::c_char;
|
||||||
|
@ -35,6 +37,19 @@ impl PlotLine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn plot_inf(&self, x: f64) {
|
||||||
|
unsafe {
|
||||||
|
sys::ImPlot_PlotInfLines_doublePtr(
|
||||||
|
self.label.as_ptr() as *const c_char,
|
||||||
|
&x,
|
||||||
|
1,
|
||||||
|
ImPlotInfLinesFlags__ImPlotInfLinesFlags_Horizontal as i32,
|
||||||
|
0,
|
||||||
|
8, /* sizeof(double) */
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn plot(&self, x: &[f64], y: &[f64]) {
|
pub fn plot(&self, x: &[f64], y: &[f64]) {
|
||||||
if x.len().min(y.len()) == 0 {
|
if x.len().min(y.len()) == 0 {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue