forked from 1b-agent/opencadstudio-upstream
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:
1 parent
7a0e08129f
commit
1cf13971dc
1 file changed
+6
-1
@@ -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,
|
||||||
|
|||||||
Reference in new issue
Block a user