GL colorize

reset properly the canvas state (such as the clip and so on)
and rotate the image otherwise it is painted upside down
This commit is contained in:
Olivier Goffart 2021-02-15 21:00:39 +01:00
parent 1a9267aebe
commit c7723a237b

View file

@ -1045,7 +1045,9 @@ impl GLItemRenderer {
let brush_paint = self.brush_to_paint(colorize_brush, &mut image_rect).unwrap();
self.shared_data.canvas.borrow_mut().save_with(|canvas| {
canvas.reset_transform();
canvas.reset();
canvas.scale(1., -1.); // Image are rendered upside down
canvas.translate(0., -image_size.height);
canvas.set_render_target(femtovg::RenderTarget::Image(colorized_image));
canvas.global_composite_operation(femtovg::CompositeOperation::Copy);