From 26030290d4f7b6dd3bd2496534a51210386ced65 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Sun, 21 Jan 2018 19:59:13 +0300 Subject: [PATCH] Fixes #148: legend.show ignored, fix it --- src/Chart.vala | 4 ++++ src/Legend.vala | 1 + 2 files changed, 5 insertions(+) diff --git a/src/Chart.vala b/src/Chart.vala index b82ffa3..6d55e99 100644 --- a/src/Chart.vala +++ b/src/Chart.vala @@ -312,6 +312,10 @@ namespace CairoChart { plarea.width = evarea.width - 2 * legend.spacing; plarea.y0 = evarea.y0 + legend.spacing; plarea.height = evarea.height - 2 * legend.spacing; + /*plarea.x0 = evarea.x0 + (legend.show ? legend.spacing : 0); + plarea.width = evarea.width - 2 * (legend.show ? legend.spacing : 0); + plarea.y0 = evarea.y0 + (legend.show ? legend.spacing : 0); + plarea.height = evarea.height - 2 * (legend.show ? legend.spacing : 0);*/ // Check for joint axes joint_x = joint_y = true; diff --git a/src/Legend.vala b/src/Legend.vala index 3bb6b6d..b0378af 100644 --- a/src/Legend.vala +++ b/src/Legend.vala @@ -42,6 +42,7 @@ namespace CairoChart { } public virtual void draw (Chart chart) { + if (!show) return; process (chart, ProcessType.CALC); process (chart, ProcessType.DRAW); }