Keep a centred image background at its device pixel size

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-10-12 12:19:03 +03:00
1 parent 7a0e08129f
commit 1cf13971dc
1 file changed
+6 -1
+6 -1
View File
@@ -431,7 +431,12 @@ impl shader::Primitive for Primitive {
vp.background_image.as_ref(), vp.background_image.as_ref(),
vp.environment_image.as_ref(), vp.environment_image.as_ref(),
); );
inner.upload_uniforms(device, queue, &vp.uniforms); // The scene works in logical pixels; an image background keeps
// its size in device pixels.
let mut uniforms = vp.uniforms;
uniforms.background_image_transform[2] /= scale.max(1e-3);
uniforms.background_image_transform[3] /= scale.max(1e-3);
inner.upload_uniforms(device, queue, &uniforms);
// ── Scene-render cache ──────────────────────────────────────── // ── Scene-render cache ────────────────────────────────────────
// A pure cursor move — or any frame where the view, geometry, // A pure cursor move — or any frame where the view, geometry,