Closes #138: Separate clear() method for pre_draw operations.

This commit is contained in:
Kolan Sh 2017-10-13 16:39:07 +03:00
parent 984e10905f
commit 4b147c15ef
2 changed files with 9 additions and 4 deletions

View File

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

View File

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