if (_layout) _layout.clear (); // drop reference to existing layout
}
+void
+PixFader::flush_pattern_cache () {
+ for (list<FaderImage*>::iterator f = _patterns.begin(); f != _patterns.end(); ++f) {
+ cairo_pattern_destroy ((*f)->pattern);
+ }
+ _patterns.clear();
+}
+
+
cairo_pattern_t*
PixFader::find_pattern (double afr, double afg, double afb,
double abr, double abg, double abb,
void
PixFader::on_size_allocate (Gtk::Allocation& alloc)
{
+ int old_girth = _girth;
+ int old_span = _span;
+
CairoWidget::on_size_allocate(alloc);
if (_orien == VERT) {
_span = alloc.get_width ();
}
- if (is_realized()) {
+ if (is_realized() && ((old_girth != _girth) || (old_span != _span))) {
/* recreate patterns in case we've changed size */
create_patterns ();
}
_text = "";
set_text (txt, _centered_text, false);
}
- /* patterns are cached and re-created as needed
+ /* patterns are cached and re-created as needed
* during 'expose' in the GUI thread */
_pattern = 0;
queue_draw ();