From ef1c12b2d150fd655b8966c73ff26cf3c587e93f Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Tue, 20 Feb 2018 14:51:15 +0300 Subject: [PATCH] Axis spacings fxd. --- src/Axis.vala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Axis.vala b/src/Axis.vala index a7faab1..b69742d 100644 --- a/src/Axis.vala +++ b/src/Axis.vala @@ -445,8 +445,8 @@ namespace CairoChart { switch (axis.dtype) { case DType.NUMBERS: var text = new Text (chart, axis.format.printf((LongDouble)x) + (horizontal ? "_" : ""), axis.font); - max_rec_width = double.max (max_rec_width, text.width + (horizontal ? text.font.hspacing : 0)); - max_rec_height = double.max (max_rec_height, text.height + (horizontal ? 0 : text.font.vspacing)); + max_rec_width = double.max (max_rec_width, text.width + 2 * text.font.hspacing); + max_rec_height = double.max (max_rec_height, text.height + 2 * text.font.vspacing); break; case DType.DATE_TIME: string date, time; @@ -455,12 +455,12 @@ namespace CairoChart { var h = 0.0; if (axis.date_format != "") { var text = new Text (chart, date + (horizontal ? "_" : ""), axis.font); - max_rec_width = double.max (max_rec_width, text.width + text.font.hspacing); + max_rec_width = double.max (max_rec_width, text.width + 2 * text.font.hspacing); h = text.height; } if (axis.time_format != "") { var text = new Text (chart, time + (horizontal ? "_" : ""), axis.font); - max_rec_width = double.max (max_rec_width, text.width + text.font.hspacing); + max_rec_width = double.max (max_rec_width, text.width + 2 * text.font.hspacing); h += text.height; } max_rec_height = double.max (max_rec_height, h);