Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Ressel <[email protected]>
  • Loading branch information
markusressel committed Oct 13, 2024
1 parent ca09c00 commit 329fcea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plot.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,15 @@ func (plot *Plot) drawAxesToScreen(screen tcell.Screen) {
tview.BoxDrawingsLightUpAndRight, axesStyle)

if plot.drawXAxisLabel {
plot.drawXAxisLabelToScreen(screen, plotYAxisLabelsWidth, x, y, width, height)
plot.drawXAxisLabelsToScreen(screen, plotYAxisLabelsWidth, x, y, width, height)
}

if plot.drawYAxisLabel {
plot.drawYAxisLabelToScreen(screen, plotYAxisLabelsWidth, x, y, height)
plot.drawYAxisLabelsToScreen(screen, plotYAxisLabelsWidth, x, y, height)
}
}

func (plot *Plot) drawXAxisLabelToScreen(
func (plot *Plot) drawXAxisLabelsToScreen(
screen tcell.Screen, plotYAxisLabelsWidth int, x int, y int, width int, height int,
) {
xAxisAreaStartX := x + plotYAxisLabelsWidth + 1
Expand Down Expand Up @@ -361,7 +361,7 @@ func (plot *Plot) printXAxisLabel(screen tcell.Screen, label string, x, y int) {
tview.Print(screen, label, x, y, len(label), tview.AlignLeft, plot.axesLabelColor)
}

func (plot *Plot) drawYAxisLabelToScreen(screen tcell.Screen, plotYAxisLabelsWidth int, x int, y int, height int) {
func (plot *Plot) drawYAxisLabelsToScreen(screen tcell.Screen, plotYAxisLabelsWidth int, x int, y int, height int) {
verticalOffset := plot.minVal
verticalScale := (plot.maxVal - plot.minVal) / float64(height-plotXAxisLabelsHeight-1)
previousLabel := ""
Expand Down

0 comments on commit 329fcea

Please sign in to comment.