fix gradient pattern origin translation for time axis view items

note: the solution is non-obvious, but the obvious one of applying a translational Cairo::Matrix to the gradient
caused an exception to be thrown because of a non-invertible matrix.
This commit is contained in:
Paul Davis
2013-06-25 20:41:24 -04:00
parent 2108525187
commit 57ff5e3198

View File

@@ -60,7 +60,14 @@ void
Fill::setup_fill_context (Cairo::RefPtr<Cairo::Context> context) const
{
if (_gradient) {
Cairo::Matrix m;
Duple origin = item_to_window (Duple (0, 0));
context->translate (origin.x, origin.y);
context->set_source (_gradient);
context->translate (-origin.x, -origin.y);
} else {
set_source_rgba (context, _fill_color);
}