From 967d8e0b4c6c12a9a9f0a0a9f0eb41337a8e0409 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Tue, 1 Apr 2025 08:12:46 +0200 Subject: [PATCH] Draw left axis on top of grid (like the other axis) --- src/curve.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/curve.c b/src/curve.c index 20e3082..4703ef2 100644 --- a/src/curve.c +++ b/src/curve.c @@ -175,28 +175,8 @@ void GuiRedrawAxes(cairo_t *cr, Curve *curve) int step; int bottom_y; - /* Draw and label the left coordinate axis */ cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE); cairo_set_line_width(cr, 1); - gdk_cairo_set_source_color(cr, Closure->foreground); - - cairo_move_to(cr, curve->leftX + 0.5, curve->topY + 0.5); - cairo_line_to(cr, curve->leftX + 0.5, curve->bottomY + 0.5); - cairo_stroke(cr); - - if(curve->enable & DRAW_LCURVE) - { cairo_move_to(cr, curve->leftX + 0.5, curve->topLY + 0.5); - cairo_line_to(cr, curve->leftX + 0.5, curve->bottomLY + 0.5); - cairo_stroke(cr); - } - - gdk_cairo_set_source_color(cr, Closure->curveColor); - GuiSetText(curve->layout, curve->leftLabel, &w, &h); - x = curve->leftX - w/2; - if(x < 5) x = 5; - cairo_move_to(cr, x, curve->topY - h - 5); - pango_cairo_show_layout(cr, curve->layout); - /* Draw and label the grid lines for the log curve */ @@ -281,6 +261,26 @@ void GuiRedrawAxes(cairo_t *cr, Curve *curve) } + /* Draw and label the left coordinate axis */ + gdk_cairo_set_source_color(cr, Closure->foreground); + + cairo_move_to(cr, curve->leftX + 0.5, curve->topY + 0.5); + cairo_line_to(cr, curve->leftX + 0.5, curve->bottomY + 0.5); + cairo_stroke(cr); + + if(curve->enable & DRAW_LCURVE) + { cairo_move_to(cr, curve->leftX + 0.5, curve->topLY + 0.5); + cairo_line_to(cr, curve->leftX + 0.5, curve->bottomLY + 0.5); + cairo_stroke(cr); + } + + gdk_cairo_set_source_color(cr, Closure->curveColor); + GuiSetText(curve->layout, curve->leftLabel, &w, &h); + x = curve->leftX - w/2; + if(x < 5) x = 5; + cairo_move_to(cr, x, curve->topY - h - 5); + pango_cairo_show_layout(cr, curve->layout); + /* Draw the right coordinate axis */ gdk_cairo_set_source_color(cr, Closure->foreground);