diff --git a/src/lines.rs b/src/lines.rs index 756b413..7e79e9e 100644 --- a/src/lines.rs +++ b/src/lines.rs @@ -1,3 +1,5 @@ +use sys::ImPlotInfLinesFlags__ImPlotInfLinesFlags_Horizontal; + use crate::sys; use std::ffi::CString; 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]) { if x.len().min(y.len()) == 0 { return;