Skip to content

Commit 95e2dca

Browse files
fix infinite footprint size
1 parent c9b94d1 commit 95e2dca

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

node-graph/gstd/src/render_node.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,15 @@ async fn render<'a: 'n>(
182182
let mut scene = vello::Scene::new();
183183
scene.append(child, Some(footprint_transform_vello));
184184

185-
let encoding = scene.encoding_mut();
185+
let resolution = (footprint.resolution.as_dvec2() * render_params.scale).as_uvec2();
186186

187187
// We now replace all transforms which are supposed to be infinite with a transform which covers the entire viewport
188188
// See <https://xi.zulipchat.com/#narrow/channel/197075-vello/topic/Full.20screen.20color.2Fgradients/near/538435044> for more detail
189-
189+
let scaled_infinite_transform = vello::kurbo::Affine::scale_non_uniform(resolution.x as f64, resolution.y as f64);
190+
let encoding = scene.encoding_mut();
190191
for transform in encoding.transforms.iter_mut() {
191192
if transform.matrix[0] == f32::INFINITY {
192-
*transform = vello_encoding::Transform::from_kurbo(&(vello::kurbo::Affine::scale_non_uniform(footprint.resolution.x as f64, footprint.resolution.y as f64)))
193+
*transform = vello_encoding::Transform::from_kurbo(&scaled_infinite_transform);
193194
}
194195
}
195196

0 commit comments

Comments
 (0)