From 19616643b06c6f27463ecbd725ae25be0bf1cfd1 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 9 Sep 2017 19:46:58 +0200 Subject: [PATCH] src/output/cairo.c (xr_chart_render): New variable chart_height --- src/output/cairo.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/output/cairo.c b/src/output/cairo.c index 045490992e..8cb504d2dd 100644 --- a/src/output/cairo.c +++ b/src/output/cairo.c @@ -1542,13 +1542,20 @@ xr_chart_render (struct xr_render_fsm *fsm, struct xr_driver *xr) { struct xr_chart_state *cs = UP_CAST (fsm, struct xr_chart_state, fsm); - if (xr->y > 0) + const int chart_height = xr->length; + + if (xr->y > xr->length - chart_height) return true; if (xr->cairo != NULL) - xr_draw_chart (cs->chart_item, xr->cairo, 0.0, 0.0, - xr_to_pt (xr->width), xr_to_pt (xr->length)); - xr->y = xr->length; + { + xr_draw_chart (cs->chart_item, xr->cairo, + 0.0, + xr_to_pt (xr->y), + xr_to_pt (xr->width), + xr_to_pt (chart_height)); + } + xr->y += chart_height; return false; } -- 2.30.2