Fix Vello rendering the infinite canvas without a white background color (#2361)

Fix infinite canvas for vello

Remove debugging fill

Remove debug log
This commit is contained in:
Dennis Kobert 2025-03-06 12:37:00 +01:00 committed by GitHub
parent e7cde88c04
commit 6becaef980
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 6 deletions

View file

@ -136,7 +136,11 @@ async fn render_canvas(render_config: RenderConfig, data: impl GraphicElementRen
// TODO: Instead of applying the transform here, pass the transform during the translation to avoid the O(Nr cost
scene.append(&child, Some(kurbo::Affine::new(footprint.transform.to_cols_array())));
exec.render_vello_scene(&scene, &surface_handle, footprint.resolution.x, footprint.resolution.y, &context)
let mut background = Color::from_rgb8_srgb(0x22, 0x22, 0x22);
if !data.contains_artboard() && !render_config.hide_artboards {
background = Color::WHITE;
}
exec.render_vello_scene(&scene, &surface_handle, footprint.resolution.x, footprint.resolution.y, &context, background)
.await
.expect("Failed to render Vello scene");