🐛 Fix clear canvas

This commit is contained in:
Elena Torro 2026-06-02 17:11:57 +02:00
parent e6f5b270de
commit d9fea603f8
2 changed files with 16 additions and 5 deletions

View File

@ -2180,8 +2180,11 @@ impl RenderState {
let frame_type = self.render_shape_tree_partial(base_object, tree, timestamp, true)?;
if !self.options.is_interactive_transform() {
self.surfaces
.draw_tile_atlas_to_backbuffer(&self.viewbox, &self.tile_viewbox);
self.surfaces.draw_tile_atlas_to_backbuffer(
&self.viewbox,
&self.tile_viewbox,
self.background_color,
);
}
match frame_type {

View File

@ -518,10 +518,18 @@ impl Surfaces {
self.tiles.clear();
}
pub fn draw_tile_atlas_to_backbuffer(&mut self, viewbox: &Viewbox, tile_viewbox: &TileViewbox) {
pub fn draw_tile_atlas_to_backbuffer(
&mut self,
viewbox: &Viewbox,
tile_viewbox: &TileViewbox,
background: skia::Color,
) {
self.tiles.update(viewbox, tile_viewbox);
self.backbuffer.canvas().draw_atlas(
&self.tile_atlas.image_snapshot(),
let atlas_image = self.tile_atlas.image_snapshot();
let canvas = self.backbuffer.canvas();
canvas.clear(background);
canvas.draw_atlas(
&atlas_image,
&self.tiles.transforms,
&self.tiles.textures,
None,