Skip to content

Commit

Permalink
plot: fix axis ticks
Browse files Browse the repository at this point in the history
Whn I was reading the code (and TODOs ;-) ) I noticed that my ticks setup was completely wrong

Now it should work as expectred
  • Loading branch information
gucio321 committed Dec 14, 2023
1 parent f83b2b8 commit 72fe361
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Plot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}

Expand Down

0 comments on commit 72fe361

Please sign in to comment.