Skip to content

Commit

Permalink
fix: imports
Browse files Browse the repository at this point in the history
  • Loading branch information
simbleau committed Jul 5, 2024
1 parent 9067f20 commit cfb0c39
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/render/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ use bevy::{
sprite::{MaterialMesh2dBundle, Mesh2dHandle},
window::{WindowResized, WindowResolution},
};
use vello::{
kurbo::{Affine, Rect},
peniko::Mix,
AaSupport, RenderParams, Renderer, RendererOptions, Scene,
};
use vello::{kurbo::Affine, AaSupport, RenderParams, Renderer, RendererOptions, Scene};

pub fn setup_image(images: &mut Assets<Image>, window: &WindowResolution) -> Handle<Image> {
let size = Extent3d {
Expand Down Expand Up @@ -134,6 +130,7 @@ pub fn render_scene(
// scene to be rendered
let mut scene_buffer = Scene::new();
for (_, _, (affine, render_item)) in render_queue.iter_mut() {
#[allow(unused_variables)]
match render_item {
RenderItem::Asset(ExtractedRenderAsset {
asset,
Expand All @@ -148,10 +145,15 @@ pub fn render_scene(
crate::VectorFile::Svg(scene) => {
if *alpha < 1.0 {
scene_buffer.push_layer(
Mix::Normal,
vello::peniko::Mix::Normal,
*alpha,
*affine,
&Rect::new(0.0, 0.0, asset.width as f64, asset.height as f64),
&vello::kurbo::Rect::new(
0.0,
0.0,
asset.width as f64,
asset.height as f64,
),
);
}
scene_buffer.append(scene, Some(*affine));
Expand All @@ -163,10 +165,15 @@ pub fn render_scene(
crate::VectorFile::Lottie(composition) => {
if *alpha < 1.0 {
scene_buffer.push_layer(
Mix::Normal,
vello::peniko::Mix::Normal,
*alpha,
*affine,
&Rect::new(0.0, 0.0, asset.width as f64, asset.height as f64),
&vello::kurbo::Rect::new(
0.0,
0.0,
asset.width as f64,
asset.height as f64,
),
);
}
velato_renderer.append(
Expand Down

0 comments on commit cfb0c39

Please sign in to comment.