In progress...

This commit is contained in:
Kolan Sh 2018-01-19 11:36:33 +03:00
parent 35018eeb4d
commit 9004e4e835
5 changed files with 10 additions and 10 deletions

View File

@ -180,7 +180,7 @@ namespace CairoChart {
* @param rect selection square. * @param rect selection square.
*/ */
public virtual void draw_selection (Cairo.Rectangle rect) { 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.rectangle (rect.x, rect.y, rect.width, rect.height);
ctx.stroke(); ctx.stroke();
} }

View File

@ -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 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 var high = Point128(chart.plarea.x, chart.plarea.y); // points of the cursor
unowned CursorCross[] ccs = cursors_crossings[cci].crossings; 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) { for (var ci = 0, max_ci = ccs.length; ci < max_ci; ++ci) {
var si = ccs[ci].series_index; var si = ccs[ci].series_index;
var s = chart.series[si]; var s = chart.series[si];

View File

@ -75,7 +75,7 @@ namespace CairoChart {
chart.color = bg_color; chart.color = bg_color;
chart.ctx.rectangle (x0, y0, width, height); chart.ctx.rectangle (x0, y0, width, height);
chart.ctx.fill(); chart.ctx.fill();
border_style.set(chart); border_style.apply(chart);
chart.ctx.move_to (x0, y0); chart.ctx.move_to (x0, y0);
chart.ctx.rel_line_to (width, 0); chart.ctx.rel_line_to (width, 0);
chart.ctx.rel_line_to (0, height); chart.ctx.rel_line_to (0, height);
@ -151,7 +151,7 @@ namespace CairoChart {
// series line style // series line style
chart.ctx.move_to (x, y - title_sz.height / 2); 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.rel_line_to (line_length, 0);
chart.ctx.stroke(); chart.ctx.stroke();
s.marker.draw_at_pos (chart, x + line_length / 2, y - title_sz.height / 2); s.marker.draw_at_pos (chart, x + line_length / 2, y - title_sz.height / 2);

View File

@ -25,7 +25,7 @@ namespace CairoChart {
this.color = color; this.color = color;
} }
public void set (Chart chart) { public void apply (Chart chart) {
chart.color = color; chart.color = color;
chart.ctx.set_line_join(join); chart.ctx.set_line_join(join);
chart.ctx.set_line_cap(cap); chart.ctx.set_line_cap(cap);

View File

@ -65,7 +65,7 @@ namespace CairoChart {
public virtual void draw () { public virtual void draw () {
var points = Math.sort_points(this, sort); var points = Math.sort_points(this, sort);
line_style.set(chart); line_style.apply(chart);
// draw series line // draw series line
for (int i = 1; i < points.length; ++i) { for (int i = 1; i < points.length; ++i) {
Point c, d; Point c, d;
@ -289,7 +289,7 @@ namespace CairoChart {
// 6. Draw grid lines to the place.zoom_y_min. // 6. Draw grid lines to the place.zoom_y_min.
var line_style = grid.line_style; var line_style = grid.line_style;
if (joint_x) line_style.color = Color(0, 0, 0, 0.5); 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); 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); ctx.move_to (scr_x, y);
if (joint_x) if (joint_x)
@ -317,7 +317,7 @@ namespace CairoChart {
// 6. Draw grid lines to the place.zoom_y_max. // 6. Draw grid lines to the place.zoom_y_max.
var line_style = grid.line_style; var line_style = grid.line_style;
if (joint_x) line_style.color = Color(0, 0, 0, 0.5); 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); 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); ctx.move_to (scr_x, y);
if (joint_x) if (joint_x)
@ -426,7 +426,7 @@ namespace CairoChart {
// 6. Draw grid lines to the place.zoom_x_min. // 6. Draw grid lines to the place.zoom_x_min.
var line_style = grid.line_style; var line_style = grid.line_style;
if (joint_y) line_style.color = Color(0, 0, 0, 0.5); 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); 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); ctx.move_to (x, scr_y);
if (joint_y) if (joint_y)
@ -442,7 +442,7 @@ namespace CairoChart {
// 6. Draw grid lines to the place.zoom_x_max. // 6. Draw grid lines to the place.zoom_x_max.
var line_style = grid.line_style; var line_style = grid.line_style;
if (joint_y) line_style.color = Color(0, 0, 0, 0.5); 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); 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); ctx.move_to (x, scr_y);
if (joint_y) if (joint_y)