Compare commits

...
Author SHA1 Message Date
Martin BallandClaude Sonnet 5.5 241bf8c94d #8853: interface size uses the document window's display scale, not the hidden root's
Cause: the zoom is context-wide and divided the display scale read from the root viewport; the windowless root (v0.20.0) has no window, so it reported none (1.0) and a chosen size drew at size x the window's real scale (too large on a scaled display, wrong on mixed DPI). Now read from the active document viewport.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FypgCXNomWeGUu3duixKdm
2026-12-05 06:15:17 +00:00
+6 -2
View File
@@ -265,8 +265,12 @@ impl WordApp {
if let Some(ctx) = self.ctx.clone() {
self.run_fired(&ctx, &out);
self.canvas.take_focus_after_pass(&ctx);
self.native_scale = theme::usable_scale(ctx.native_pixels_per_point().unwrap_or(1.0));
if let Some(native) = ctx.native_pixels_per_point()
// The zoom is context-wide but the display scale is per window: read it from the active
// document window. The windowless root has no window, so it reports none (#8853).
let active = self.active_viewport();
let native_now = ctx.input_for(active, |i| i.viewport().native_pixels_per_point).or_else(|| ctx.native_pixels_per_point());
self.native_scale = theme::usable_scale(native_now.unwrap_or(1.0));
if let Some(native) = native_now
&& let Some(old) = self.legacy_interface_size.take()
{
self.ui.interface_size = theme::migrate_legacy_interface_size(old, native);