From dcfb85126e8f3a3ead27d1762bc0addf9799340b Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Mon, 15 Jan 2018 16:18:47 +0300 Subject: [PATCH] In progress... --- src/Axis.vala | 8 ++++---- src/Chart.vala | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Axis.vala b/src/Axis.vala index 9c7a2b5..f8c6095 100644 --- a/src/Axis.vala +++ b/src/Axis.vala @@ -110,13 +110,13 @@ namespace CairoChart { time = dt.format(time_format) + dsec_str; } - public virtual void calc_rec_sizes (Chart chart, out double max_rec_width, out double max_rec_height, bool is_horizontal = true) { + public virtual void calc_rec_sizes (Chart chart, out double max_rec_width, out double max_rec_height, bool horizontal = true) { max_rec_width = max_rec_height = 0; for (var i = 0; i < nrecords; ++i) { Float128 x = (int64)(zoom_min + (zoom_max - zoom_min) / nrecords * i) + 1.0/3.0; switch (type) { case Axis.Type.NUMBERS: - var text = new Text (format.printf((LongDouble)x) + (is_horizontal ? "_" : ""), font_style); + var text = new Text (format.printf((LongDouble)x) + (horizontal ? "_" : ""), font_style); var sz = text.get_size(chart.context); max_rec_width = double.max (max_rec_width, sz.width); max_rec_height = double.max (max_rec_height, sz.height); @@ -127,13 +127,13 @@ namespace CairoChart { var h = 0.0; if (date_format != "") { - var text = new Text (date + (is_horizontal ? "_" : ""), font_style); + var text = new Text (date + (horizontal ? "_" : ""), font_style); var sz = text.get_size(chart.context); max_rec_width = double.max (max_rec_width, sz.width); h = sz.height; } if (time_format != "") { - var text = new Text (time + (is_horizontal ? "_" : ""), font_style); + var text = new Text (time + (horizontal ? "_" : ""), font_style); var sz = text.get_size(chart.context); max_rec_width = double.max (max_rec_width, sz.width); h += sz.height; diff --git a/src/Chart.vala b/src/Chart.vala index 517d189..4479cdf 100644 --- a/src/Chart.vala +++ b/src/Chart.vala @@ -251,7 +251,7 @@ namespace CairoChart { if (nzoom_series_show == 1) joint_x = joint_y = false; // Join and calc X-axes - for (var si = series.length - 1, nskip = 0; si >=0; --si) { + for (var si = series.length - 1, nskip = 0; si >= 0; --si) { var s = series[si]; if (!s.zoom_show) continue; if (nskip != 0) {--nskip; continue;} @@ -278,7 +278,7 @@ namespace CairoChart { } // Join and calc Y-axes - for (var si = series.length - 1, nskip = 0; si >=0; --si) { + for (var si = series.length - 1, nskip = 0; si >= 0; --si) { var s = series[si]; if (!s.zoom_show) continue; if (nskip != 0) {--nskip; continue;}