Bugfix: Curve's bg and Histogram's bg wasn't cleaned upon refresh
This commit is contained in:
@@ -956,7 +956,10 @@ SSEFUNCTION void HistogramArea::updateBackBuffer ()
|
|||||||
Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create(surface);
|
Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create(surface);
|
||||||
const Glib::RefPtr<Gtk::StyleContext> style = get_style_context();
|
const Glib::RefPtr<Gtk::StyleContext> style = get_style_context();
|
||||||
|
|
||||||
style->render_background(cr, 0, 0, surface->get_width(), surface->get_height());
|
cr->set_source_rgba (0., 0., 0., 0.);
|
||||||
|
cr->set_operator (Cairo::OPERATOR_CLEAR);
|
||||||
|
cr->paint ();
|
||||||
|
cr->set_operator (Cairo::OPERATOR_OVER);
|
||||||
|
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// For RAW mode use the other hists
|
// For RAW mode use the other hists
|
||||||
@@ -1215,6 +1218,8 @@ bool HistogramArea::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
|
|||||||
updateBackBuffer ();
|
updateBackBuffer ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Glib::RefPtr<Gtk::StyleContext> style = get_style_context();
|
||||||
|
style->render_background(cr, winx, winy, winw, winh);
|
||||||
copySurface(cr, NULL);
|
copySurface(cr, NULL);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -210,9 +210,7 @@ void MyDiagonalCurve::draw (int handle)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Glib::RefPtr<Gdk::Window > win = get_window();
|
if (!surfaceCreated()) {
|
||||||
|
|
||||||
if (!surfaceCreated() || !win) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,7 +230,10 @@ void MyDiagonalCurve::draw (int handle)
|
|||||||
cr->set_line_cap(Cairo::LINE_CAP_SQUARE);
|
cr->set_line_cap(Cairo::LINE_CAP_SQUARE);
|
||||||
|
|
||||||
// clear background
|
// 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;
|
Gdk::RGBA c;
|
||||||
|
|
||||||
@@ -425,7 +426,7 @@ void MyDiagonalCurve::draw (int handle)
|
|||||||
// first the background
|
// first the background
|
||||||
int bWidth = CBAR_WIDTH;
|
int bWidth = CBAR_WIDTH;
|
||||||
BackBuffer *bb = this;
|
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);
|
leftBar->expose(bb);
|
||||||
|
|
||||||
// now the border
|
// now the border
|
||||||
@@ -440,7 +441,7 @@ void MyDiagonalCurve::draw (int handle)
|
|||||||
// first the background
|
// first the background
|
||||||
int bWidth = CBAR_WIDTH;
|
int bWidth = CBAR_WIDTH;
|
||||||
BackBuffer *bb = this;
|
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);
|
bottomBar->expose(bb);
|
||||||
|
|
||||||
// now the border
|
// now the border
|
||||||
@@ -497,13 +498,12 @@ void MyDiagonalCurve::draw (int handle)
|
|||||||
|
|
||||||
bool MyDiagonalCurve::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
|
bool MyDiagonalCurve::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
|
||||||
{
|
{
|
||||||
Glib::RefPtr<Gdk::Window> win = get_window();
|
|
||||||
Gtk::Allocation allocation = get_allocation();
|
Gtk::Allocation allocation = get_allocation();
|
||||||
allocation.set_x(0);
|
allocation.set_x(0);
|
||||||
allocation.set_y(0);
|
allocation.set_y(0);
|
||||||
|
|
||||||
// setDrawRectangle will allocate the backbuffer Surface
|
// setDrawRectangle will allocate the backbuffer Surface
|
||||||
if (setDrawRectangle(win, allocation)) {
|
if (setDrawRectangle(Cairo::FORMAT_ARGB32, allocation)) {
|
||||||
setDirty(true);
|
setDirty(true);
|
||||||
|
|
||||||
if (prevGraphW > GRAPH_SIZE || graphW > GRAPH_SIZE) {
|
if (prevGraphW > GRAPH_SIZE || graphW > GRAPH_SIZE) {
|
||||||
@@ -511,6 +511,8 @@ bool MyDiagonalCurve::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 (lit_point);
|
draw (lit_point);
|
||||||
copySurface(cr);
|
copySurface(cr);
|
||||||
return false;
|
return false;
|
||||||
|
@@ -116,9 +116,7 @@ void MyFlatCurve::draw ()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Glib::RefPtr<Gdk::Window> win = get_window();
|
if (!surfaceCreated()) {
|
||||||
|
|
||||||
if (!surfaceCreated() || !win) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +137,10 @@ void MyFlatCurve::draw ()
|
|||||||
cr->set_line_cap(Cairo::LINE_CAP_SQUARE);
|
cr->set_line_cap(Cairo::LINE_CAP_SQUARE);
|
||||||
|
|
||||||
// clear background
|
// 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;
|
Gdk::RGBA c;
|
||||||
|
|
||||||
@@ -166,7 +167,7 @@ void MyFlatCurve::draw ()
|
|||||||
// first the background
|
// first the background
|
||||||
int bWidth = CBAR_WIDTH;
|
int bWidth = CBAR_WIDTH;
|
||||||
BackBuffer *bb = this;
|
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);
|
leftBar->expose(bb);
|
||||||
|
|
||||||
// now the border
|
// now the border
|
||||||
@@ -181,7 +182,7 @@ void MyFlatCurve::draw ()
|
|||||||
// first the background
|
// first the background
|
||||||
int bWidth = CBAR_WIDTH;
|
int bWidth = CBAR_WIDTH;
|
||||||
BackBuffer *bb = this;
|
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);
|
bottomBar->expose(bb);
|
||||||
|
|
||||||
// now the border
|
// now the border
|
||||||
@@ -501,13 +502,12 @@ void MyFlatCurve::draw ()
|
|||||||
|
|
||||||
bool MyFlatCurve::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
|
bool MyFlatCurve::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
|
||||||
{
|
{
|
||||||
Glib::RefPtr<Gdk::Window> win = get_window();
|
|
||||||
Gtk::Allocation allocation = get_allocation();
|
Gtk::Allocation allocation = get_allocation();
|
||||||
allocation.set_x(0);
|
allocation.set_x(0);
|
||||||
allocation.set_y(0);
|
allocation.set_y(0);
|
||||||
|
|
||||||
// setDrawRectangle will allocate the backbuffer Surface
|
// setDrawRectangle will allocate the backbuffer Surface
|
||||||
if (setDrawRectangle(win, allocation)) {
|
if (setDrawRectangle(Cairo::FORMAT_ARGB32, allocation)) {
|
||||||
setDirty(true);
|
setDirty(true);
|
||||||
|
|
||||||
if (prevGraphW > GRAPH_SIZE || graphW > GRAPH_SIZE) {
|
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 ();
|
draw ();
|
||||||
copySurface(cr);
|
copySurface(cr);
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user