Merge branch '#138_pre_post_draw' into develop

This commit is contained in:
Kolan Sh 2017-10-13 16:39:26 +03:00
commit d39cfb7f04
2 changed files with 9 additions and 4 deletions

View File

@ -46,9 +46,11 @@ namespace Gtk.CairoChart {
cur_y_max = cur_y_min; cur_y_max = cur_y_min;
} }
public virtual bool draw () { public virtual void clear () {
draw_background (); draw_background ();
}
public virtual bool draw () {
cur_x_min = cur_y_min = 0.0; cur_x_min = cur_y_min = 0.0;
cur_x_max = width; cur_x_max = width;

View File

@ -340,11 +340,14 @@ int main (string[] args) {
double mov_x0 = 0, mov_y0 = 0; double mov_x0 = 0, mov_y0 = 0;
da.draw.connect((context) => { da.draw.connect((context) => {
// user's pre draw operations here...
chart.context = context; chart.context = context;
chart.width = da.get_allocated_width(); chart.width = da.get_allocated_width();
chart.height = da.get_allocated_height(); chart.height = da.get_allocated_height();
chart.clear();
// user's pre draw operations here...
// ...
/*var ret = */chart.draw(); /*var ret = */chart.draw();
// user's post draw operations here... // user's post draw operations here...