Fix size of 'wasm renderer' debug text on dpr > 1

This commit is contained in:
Belén Albeza 2025-06-20 10:41:54 +02:00
parent 38112e287a
commit 2412402a23
13 changed files with 6 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 150 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 KiB

After

Width:  |  Height:  |  Size: 512 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

View file

@ -275,6 +275,7 @@ impl RenderState {
self.viewbox.width.floor() as i32,
self.viewbox.height.floor() as i32,
);
self.fonts.set_scale_debug_font(dpr);
}
}

View file

@ -47,6 +47,11 @@ impl FontStore {
}
}
pub fn set_scale_debug_font(&mut self, dpr: f32) {
let debug_font = skia::Font::new(self.debug_font.typeface(), 10.0 * dpr);
self.debug_font = debug_font;
}
pub fn font_provider(&self) -> &textlayout::TypefaceFontProvider {
&self.font_provider
}