Bugfix: Curve's bg and Histogram's bg wasn't cleaned upon refresh
This commit is contained in:
@@ -116,9 +116,7 @@ void MyFlatCurve::draw ()
|
||||
return;
|
||||
}
|
||||
|
||||
Glib::RefPtr<Gdk::Window> win = get_window();
|
||||
|
||||
if (!surfaceCreated() || !win) {
|
||||
if (!surfaceCreated()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -139,7 +137,10 @@ void MyFlatCurve::draw ()
|
||||
cr->set_line_cap(Cairo::LINE_CAP_SQUARE);
|
||||
|
||||
// clear background
|
||||
style->render_background(cr, 0., 0., double(getWidth()), double(getHeight()));
|
||||
cr->set_source_rgba (0., 0., 0., 0.);
|
||||
cr->set_operator (Cairo::OPERATOR_CLEAR);
|
||||
cr->paint ();
|
||||
cr->set_operator (Cairo::OPERATOR_OVER);
|
||||
|
||||
Gdk::RGBA c;
|
||||
|
||||
@@ -166,7 +167,7 @@ void MyFlatCurve::draw ()
|
||||
// first the background
|
||||
int bWidth = CBAR_WIDTH;
|
||||
BackBuffer *bb = this;
|
||||
leftBar->setDrawRectangle(win, 1, graphY - graphH + 1, bWidth - 2, graphH - 2);
|
||||
leftBar->setDrawRectangle(Cairo::FORMAT_ARGB32, 1, graphY - graphH + 1, bWidth - 2, graphH - 2);
|
||||
leftBar->expose(bb);
|
||||
|
||||
// now the border
|
||||
@@ -181,7 +182,7 @@ void MyFlatCurve::draw ()
|
||||
// first the background
|
||||
int bWidth = CBAR_WIDTH;
|
||||
BackBuffer *bb = this;
|
||||
bottomBar->setDrawRectangle(win, graphX + 1, graphY + CBAR_MARGIN + 1, graphW - 2, bWidth - 2);
|
||||
bottomBar->setDrawRectangle(Cairo::FORMAT_ARGB32, graphX + 1, graphY + CBAR_MARGIN + 1, graphW - 2, bWidth - 2);
|
||||
bottomBar->expose(bb);
|
||||
|
||||
// now the border
|
||||
@@ -501,13 +502,12 @@ void MyFlatCurve::draw ()
|
||||
|
||||
bool MyFlatCurve::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
|
||||
{
|
||||
Glib::RefPtr<Gdk::Window> win = get_window();
|
||||
Gtk::Allocation allocation = get_allocation();
|
||||
allocation.set_x(0);
|
||||
allocation.set_y(0);
|
||||
|
||||
// setDrawRectangle will allocate the backbuffer Surface
|
||||
if (setDrawRectangle(win, allocation)) {
|
||||
if (setDrawRectangle(Cairo::FORMAT_ARGB32, allocation)) {
|
||||
setDirty(true);
|
||||
|
||||
if (prevGraphW > GRAPH_SIZE || graphW > GRAPH_SIZE) {
|
||||
@@ -515,6 +515,8 @@ bool MyFlatCurve::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
|
||||
}
|
||||
}
|
||||
|
||||
Glib::RefPtr<Gtk::StyleContext> style = get_style_context();
|
||||
style->render_background(cr, 0., 0., (double)get_width(), (double)get_height());
|
||||
draw ();
|
||||
copySurface(cr);
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user