Closes #138: Separate clear() method for pre_draw operations.
This commit is contained in:
parent
984e10905f
commit
4b147c15ef
|
@ -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;
|
||||
|
|
|
@ -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...
|
||||
|
|
Loading…
Reference in New Issue