Updated to newest available implot

This commit is contained in:
4bb4 2020-10-31 11:04:13 +01:00
parent b6a7cae830
commit af0996390a
6 changed files with 2507 additions and 200 deletions

View file

@ -83,7 +83,7 @@ pub enum Marker {
/// Colorable plot elements. These are called "ImPlotCol" in ImPlot itself, but I found that
/// name somewhat confusing because we are not referring to colors, but _which_ thing can
/// be colored - hence I added the "Element".
#[repr(i32)]
#[repr(u32)]
#[derive(Copy, Clone, Debug)]
pub enum PlotColorElement {
/// Plot line/outline color (defaults to next unused color in current colormap)
@ -137,7 +137,7 @@ pub enum PlotColorElement {
}
/// Colormap choice. Documentation copied from implot.h for convenience.
#[repr(i32)]
#[repr(u32)]
#[derive(Copy, Clone, Debug)]
pub enum Colormap {
/// ImPlot default colormap (n=10). Called "Standard" here because Default is reserved.
@ -164,7 +164,7 @@ pub enum Colormap {
Jet = sys::ImPlotColormap__ImPlotColormap_Jet,
}
#[repr(i32)]
#[repr(u32)]
#[derive(Copy, Clone, Debug)]
pub enum StyleVar {
/// f32, line weight in pixels
@ -207,8 +207,16 @@ pub enum StyleVar {
LabelPadding = sys::ImPlotStyleVar__ImPlotStyleVar_LabelPadding,
/// ImVec2, legend padding from top-left of plot
LegendPadding = sys::ImPlotStyleVar__ImPlotStyleVar_LegendPadding,
/// ImVec2, legend inner padding from legend edges
LegendInnerPadding = sys::ImPlotStyleVar__ImPlotStyleVar_LegendInnerPadding,
/// ImVec2, spacing between legend entries
LegendSpacing = sys::ImPlotStyleVar__ImPlotStyleVar_LegendSpacing,
/// ImVec2, padding between plot edge and interior info text
InfoPadding = sys::ImPlotStyleVar__ImPlotStyleVar_InfoPadding,
MousePosPadding = sys::ImPlotStyleVar__ImPlotStyleVar_MousePosPadding,
/// ImVec2, text padding around annotation labels
AnnotationPadding = sys::ImPlotStyleVar__ImPlotStyleVar_AnnotationPadding,
/// ImVec2, default size used when ImVec2(0,0) is passed to BeginPlot
PlotDefaultSize = sys::ImPlotStyleVar__ImPlotStyleVar_PlotDefaultSize,
/// ImVec2, minimum size plot frame can be when shrunk
PlotMinSize = sys::ImPlotStyleVar__ImPlotStyleVar_PlotMinSize,
}

View file

@ -17,7 +17,7 @@ bitflags! {
/// convenience. ImPlot itself also has a "CanvasOnly" flag, which can be emulated here with
/// the combination of `NO_LEGEND`, `NO_MENUS`, `NO_BOX_SELECT` and `NO_MOUSE_POSITION`.
#[repr(transparent)]
pub struct PlotFlags: i32 {
pub struct PlotFlags: u32 {
/// "Default" according to original docs
const NONE = sys::ImPlotFlags__ImPlotFlags_None;
/// Plot items will not be highlighted when their legend entry is hovered
@ -51,7 +51,7 @@ bitflags! {
/// has `Lock`, which combines `LOCK_MIN` and `LOCK_MAX`, and `NoDecorations`, which combines
/// `NO_GRID_LINES`, `NO_TICK_MARKS` and `NO_TICK_LABELS`.
#[repr(transparent)]
pub struct AxisFlags: i32 {
pub struct AxisFlags: u32 {
/// "Default" according to original docs
const NONE = sys::ImPlotAxisFlags__ImPlotAxisFlags_None;
/// Grid lines will not be displayed

View file

@ -191,7 +191,7 @@ impl PlotText {
}
unsafe {
sys::ImPlot_PlotTextdouble(
sys::ImPlot_PlotText(
im_str!("{}", self.label).as_ptr() as *const i8,
x,
y,