add ArdourCanvas::Fill::set_pattern() to allow any filled canvas item to be filled using an arbitrary Cairo Pattern

This commit is contained in:
Paul Davis 2014-09-19 16:21:19 -04:00
parent 75a150ecc0
commit 98d1200f2c
2 changed files with 15 additions and 1 deletions

View file

@ -72,7 +72,11 @@ Fill::set_fill (bool fill)
void
Fill::setup_fill_context (Cairo::RefPtr<Cairo::Context> context) const
{
set_source_rgba (context, _fill_color);
if (_pattern) {
context->set_source (_pattern);
} else {
set_source_rgba (context, _fill_color);
}
}
void
@ -95,6 +99,12 @@ Fill::setup_gradient_context (Cairo::RefPtr<Cairo::Context> context, Rect const
context->set_source (_gradient);
}
void
Fill::set_pattern (Cairo::RefPtr<Cairo::Pattern> p)
{
_pattern = p;
}
void
Fill::set_gradient (StopList const & stops, bool vertical)
{