From 89132d91fc0fa6f8dc11420f7bfe1ff13e037c85 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Sat, 20 Jan 2018 12:43:02 +0300 Subject: [PATCH] In progress... --- src/Chart.vala | 2 +- src/Font.vala | 22 +++++++++++----------- src/Line.vala | 10 +++++----- test/ChartTest.vala | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Chart.vala b/src/Chart.vala index b82c205..f4d8ca2 100644 --- a/src/Chart.vala +++ b/src/Chart.vala @@ -59,7 +59,7 @@ namespace CairoChart { public Series[] series = {}; /** - * Index of the 1'st shown series in a zoommed area. + * Index of the 1'st shown series in a zoomed area. */ public int zoom_1st_idx { get; protected set; default = 0; } diff --git a/src/Font.vala b/src/Font.vala index 58e8009..e0edeb4 100644 --- a/src/Font.vala +++ b/src/Font.vala @@ -31,6 +31,11 @@ namespace CairoChart { */ string family; + /** + * The new font size, in user space units. + */ + double size; + /** * The slant for the font. */ @@ -41,11 +46,6 @@ namespace CairoChart { */ Cairo.FontWeight weight; - /** - * The new font size, in user space units. - */ - double size; - /** * Font/Text orientation. */ @@ -54,21 +54,21 @@ namespace CairoChart { /** * Constructs a new ``Style``. * @param family a font family name, encoded in UTF-8. + * @param size the new font size, in user space units. * @param slant the slant for the font. * @param weight the weight for the font. - * @param size the new font size, in user space units. * @param orientation font/text orientation. */ public Style (string family = "Sans", - Cairo.FontSlant slant = Cairo.FontSlant.NORMAL, - Cairo.FontWeight weight = Cairo.FontWeight.NORMAL, - double size = 10, - Font.Orientation orientation = Font.Orientation.HORIZONTAL + double size = 10, + Cairo.FontSlant slant = Cairo.FontSlant.NORMAL, + Cairo.FontWeight weight = Cairo.FontWeight.NORMAL, + Font.Orientation orientation = Font.Orientation.HORIZONTAL ) { this.family = family; + this.size = size; this.slant = slant; this.weight = weight; - this.size = size; this.orientation = orientation; } } diff --git a/src/Line.vala b/src/Line.vala index 74e56df..3add9ad 100644 --- a/src/Line.vala +++ b/src/Line.vala @@ -55,12 +55,12 @@ namespace CairoChart { Cairo.LineJoin join = Cairo.LineJoin.MITER, Cairo.LineCap cap = Cairo.LineCap.ROUND ) { + this.color = color; this.width = width; - this.join = join; - this.cap = cap; this.dashes = dashes; this.dash_offset = dash_offset; - this.color = color; + this.join = join; + this.cap = cap; } /** @@ -68,10 +68,10 @@ namespace CairoChart { */ public void apply (Chart chart) { chart.color = color; - chart.ctx.set_line_join(join); - chart.ctx.set_line_cap(cap); chart.ctx.set_line_width(width); chart.ctx.set_dash(dashes, dash_offset); + chart.ctx.set_line_join(join); + chart.ctx.set_line_cap(cap); } } diff --git a/test/ChartTest.vala b/test/ChartTest.vala index 2edbd00..c4b442b 100644 --- a/test/ChartTest.vala +++ b/test/ChartTest.vala @@ -249,7 +249,7 @@ int main (string[] args) { plot_chart3 (chart3); plot_chart4 (chart4); - chart1.selection_style = Line.Style(Color(0.3, 0.3, 0.3, 0.7), 1); + chart1.selection_style = Line.Style(Color(0.3, 0.3, 0.3, 0.7)); var da = new DrawingArea(); da.set_events ( Gdk.EventMask.BUTTON_PRESS_MASK