mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-04 01:08:13 +08:00
Fix SVG renderer not playing animation due to a regression from the tile cache discarding the context (#4092)
This commit is contained in:
@@ -334,14 +334,14 @@ pub async fn render_output_cache<'a: 'n>(
|
|||||||
let footprint = ctx.footprint();
|
let footprint = ctx.footprint();
|
||||||
let Some(render_params) = ctx.vararg(0).ok().and_then(|v| v.downcast_ref::<RenderParams>()) else {
|
let Some(render_params) = ctx.vararg(0).ok().and_then(|v| v.downcast_ref::<RenderParams>()) else {
|
||||||
log::warn!("render_output_cache: missing or invalid render params, falling back to direct render");
|
log::warn!("render_output_cache: missing or invalid render params, falling back to direct render");
|
||||||
let context = OwnedContextImpl::empty().with_footprint(*footprint);
|
let context = OwnedContextImpl::from(ctx.clone()).with_footprint(*footprint);
|
||||||
return data.eval(context.into_context()).await;
|
return data.eval(context.into_context()).await;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fall back to direct render for non-Vello or zero-size viewports
|
// Fall back to direct render for non-Vello or zero-size viewports
|
||||||
let physical_resolution = footprint.resolution;
|
let physical_resolution = footprint.resolution;
|
||||||
if !matches!(render_params.render_output_type, RenderOutputTypeRequest::Vello) || physical_resolution.x == 0 || physical_resolution.y == 0 {
|
if !matches!(render_params.render_output_type, RenderOutputTypeRequest::Vello) || physical_resolution.x == 0 || physical_resolution.y == 0 {
|
||||||
let context = OwnedContextImpl::empty().with_footprint(*footprint).with_vararg(Box::new(render_params.clone()));
|
let context = OwnedContextImpl::from(ctx.clone()).with_footprint(*footprint).with_vararg(Box::new(render_params.clone()));
|
||||||
return data.eval(context.into_context()).await;
|
return data.eval(context.into_context()).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,11 +396,11 @@ pub async fn render_output_cache<'a: 'n>(
|
|||||||
|
|
||||||
tile_cache.store_regions(new_regions.clone());
|
tile_cache.store_regions(new_regions.clone());
|
||||||
|
|
||||||
let all_regions: Vec<_> = cache_query.cached_regions.into_iter().chain(new_regions.into_iter()).collect();
|
let all_regions: Vec<_> = cache_query.cached_regions.into_iter().chain(new_regions).collect();
|
||||||
|
|
||||||
// If no regions, fall back to direct render
|
// If no regions, fall back to direct render
|
||||||
if all_regions.is_empty() {
|
if all_regions.is_empty() {
|
||||||
let context = OwnedContextImpl::empty().with_footprint(*footprint).with_vararg(Box::new(render_params.clone()));
|
let context = OwnedContextImpl::from(ctx.clone()).with_footprint(*footprint).with_vararg(Box::new(render_params.clone()));
|
||||||
return data.eval(context.into_context()).await;
|
return data.eval(context.into_context()).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user