From 47bcb48e19d2287cbeed532dbfd2c4588b439826 Mon Sep 17 00:00:00 2001 From: Benedikt Mandelkow Date: Mon, 19 Oct 2020 01:32:48 +0200 Subject: [PATCH] antialias by default --- src/plot.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plot.rs b/src/plot.rs index e978dfd..e276e3f 100644 --- a/src/plot.rs +++ b/src/plot.rs @@ -144,6 +144,7 @@ pub struct Plot { impl Plot { /// Create a new plot with some defaults set. Does not draw anything yet. + /// Note that this uses antialiasing by default, unlike the C++ API. If you are seeing artifacts or weird rendering, try disabling it. pub fn new(title: &str) -> Self { // Needed for initialization, see https://github.com/rust-lang/rust/issues/49147 const POS_NONE: Option> = None; @@ -166,7 +167,7 @@ impl Plot { y_tick_positions: [POS_NONE; NUMBER_OF_Y_AXES], y_tick_labels: [TICK_NONE; NUMBER_OF_Y_AXES], show_y_default_ticks: [false; NUMBER_OF_Y_AXES], - plot_flags: PlotFlags::NONE.bits() as sys::ImPlotFlags, + plot_flags: PlotFlags::ANTIALIASED.bits() as sys::ImPlotFlags, x_flags: AxisFlags::NONE.bits() as sys::ImPlotAxisFlags, y_flags: [AxisFlags::NONE.bits() as sys::ImPlotAxisFlags; NUMBER_OF_Y_AXES], }