From 9004e4e83596dbe6a0f056e759285c35cafecfcb Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Fri, 19 Jan 2018 11:36:33 +0300 Subject: [PATCH] In progress... --- src/Chart.vala | 2 +- src/Cursor.vala | 2 +- src/Legend.vala | 4 ++-- src/Line.vala | 2 +- src/Series.vala | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Chart.vala b/src/Chart.vala index 1e3a549..c236fae 100644 --- a/src/Chart.vala +++ b/src/Chart.vala @@ -180,7 +180,7 @@ namespace CairoChart { * @param rect selection square. */ public virtual void draw_selection (Cairo.Rectangle rect) { - selection_style.set(this); + selection_style.apply(this); ctx.rectangle (rect.x, rect.y, rect.width, rect.height); ctx.stroke(); } diff --git a/src/Cursor.vala b/src/Cursor.vala index 978be1c..57a101c 100644 --- a/src/Cursor.vala +++ b/src/Cursor.vala @@ -247,7 +247,7 @@ namespace CairoChart { var low = Point128(chart.plarea.x + chart.plarea.width, chart.plarea.y + chart.plarea.height); // low and high var high = Point128(chart.plarea.x, chart.plarea.y); // points of the cursor unowned CursorCross[] ccs = cursors_crossings[cci].crossings; - cursor_style.line_style.set(chart); + cursor_style.line_style.apply(chart); for (var ci = 0, max_ci = ccs.length; ci < max_ci; ++ci) { var si = ccs[ci].series_index; var s = chart.series[si]; diff --git a/src/Legend.vala b/src/Legend.vala index 47dedb7..5e5db91 100644 --- a/src/Legend.vala +++ b/src/Legend.vala @@ -75,7 +75,7 @@ namespace CairoChart { chart.color = bg_color; chart.ctx.rectangle (x0, y0, width, height); chart.ctx.fill(); - border_style.set(chart); + border_style.apply(chart); chart.ctx.move_to (x0, y0); chart.ctx.rel_line_to (width, 0); chart.ctx.rel_line_to (0, height); @@ -151,7 +151,7 @@ namespace CairoChart { // series line style chart.ctx.move_to (x, y - title_sz.height / 2); - s.line_style.set(chart); + s.line_style.apply(chart); chart.ctx.rel_line_to (line_length, 0); chart.ctx.stroke(); s.marker.draw_at_pos (chart, x + line_length / 2, y - title_sz.height / 2); diff --git a/src/Line.vala b/src/Line.vala index a100046..06ed962 100644 --- a/src/Line.vala +++ b/src/Line.vala @@ -25,7 +25,7 @@ namespace CairoChart { this.color = color; } - public void set (Chart chart) { + public void apply (Chart chart) { chart.color = color; chart.ctx.set_line_join(join); chart.ctx.set_line_cap(cap); diff --git a/src/Series.vala b/src/Series.vala index 9493c79..27a389d 100644 --- a/src/Series.vala +++ b/src/Series.vala @@ -65,7 +65,7 @@ namespace CairoChart { public virtual void draw () { var points = Math.sort_points(this, sort); - line_style.set(chart); + line_style.apply(chart); // draw series line for (int i = 1; i < points.length; ++i) { Point c, d; @@ -289,7 +289,7 @@ namespace CairoChart { // 6. Draw grid lines to the place.zoom_y_min. var line_style = grid.line_style; if (joint_x) line_style.color = Color(0, 0, 0, 0.5); - line_style.set(chart); + line_style.apply(chart); double y = chart.evarea.y + chart.evarea.height - max_rec_height - axis_x.font_spacing - (axis_x.title.text == "" ? 0 : sz.height + axis_x.font_spacing); ctx.move_to (scr_x, y); if (joint_x) @@ -317,7 +317,7 @@ namespace CairoChart { // 6. Draw grid lines to the place.zoom_y_max. var line_style = grid.line_style; if (joint_x) line_style.color = Color(0, 0, 0, 0.5); - line_style.set(chart); + line_style.apply(chart); double y = chart.evarea.y + max_rec_height + axis_x.font_spacing + (axis_x.title.text == "" ? 0 : sz.height + axis_x.font_spacing); ctx.move_to (scr_x, y); if (joint_x) @@ -426,7 +426,7 @@ namespace CairoChart { // 6. Draw grid lines to the place.zoom_x_min. var line_style = grid.line_style; if (joint_y) line_style.color = Color(0, 0, 0, 0.5); - line_style.set(chart); + line_style.apply(chart); double x = chart.evarea.x + max_rec_width + axis_y.font_spacing + (axis_y.title.text == "" ? 0 : sz.width + axis_y.font_spacing); ctx.move_to (x, scr_y); if (joint_y) @@ -442,7 +442,7 @@ namespace CairoChart { // 6. Draw grid lines to the place.zoom_x_max. var line_style = grid.line_style; if (joint_y) line_style.color = Color(0, 0, 0, 0.5); - line_style.set(chart); + line_style.apply(chart); double x = chart.evarea.x + chart.evarea.width - max_rec_width - axis_y.font_spacing - (axis_y.title.text == "" ? 0 : sz.width + axis_y.font_spacing); ctx.move_to (x, scr_y); if (joint_y)