From 72fe361ecebdf40d4737d6b8048781adc82722ae Mon Sep 17 00:00:00 2001 From: gucio321 Date: Thu, 14 Dec 2023 16:03:22 +0100 Subject: [PATCH] plot: fix axis ticks Whn I was reading the code (and TODOs ;-) ) I noticed that my ticks setup was completely wrong Now it should work as expectred --- Plot.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Plot.go b/Plot.go index 2dc6290c..b7b26398 100644 --- a/Plot.go +++ b/Plot.go @@ -190,24 +190,22 @@ func (p *PlotCanvasWidget) Build() { ) if len(p.xTicksValue) > 0 { - imgui.PlotSetupAxisTicksdoubleV( + imgui.PlotSetupAxisTicksdoublePtrV( imgui.AxisX1, - p.xTicksValue[0], - p.xTicksValue[1], // <- TODO: why is it so strangely saved? - -1, // TODO: implement + &p.xTicksValue, + int32(len(p.xTicksValue)), p.xTicksLabel, p.xTicksShowDefault, ) } if len(p.yTicksValue) > 0 { - imgui.PlotSetupAxisTicksdoubleV( + imgui.PlotSetupAxisTicksdoublePtrV( imgui.AxisY1, - p.xTicksValue[0], - p.xTicksValue[1], // <- TODO: why is it so strangely saved? - -1, // TODO: implement - p.xTicksLabel, - p.xTicksShowDefault, + &p.yTicksValue, + int32(len(p.yTicksValue)), + p.yTicksLabel, + p.yTicksShowDefault, ) }