From 718b1fb5358bfd221561938d61dbdd90309d2803 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 30 Nov 2019 07:29:24 -0800 Subject: [PATCH] window: wayland: make dpi values for sw and gl the same Make the numbers consistent with each other --- window/src/os/wayland/window.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/window/src/os/wayland/window.rs b/window/src/os/wayland/window.rs index 05ee754f5..305906f1e 100644 --- a/window/src/os/wayland/window.rs +++ b/window/src/os/wayland/window.rs @@ -892,6 +892,7 @@ impl WaylandWindowInner { let mut context = MmapImage { mmap: self.pool.mmap(), dimensions: (self.dimensions.0 as usize, self.dimensions.1 as usize), + dpi: 96 * toolkit::surface::get_dpi_factor(&self.surface) as usize, }; self.callbacks.paint(&mut context); context.mmap.flush()?; @@ -936,6 +937,7 @@ impl WaylandWindowInner { struct MmapImage<'a> { mmap: &'a mut memmap::MmapMut, dimensions: (usize, usize), + dpi: usize, } impl<'a> BitmapImage for MmapImage<'a> { @@ -966,7 +968,7 @@ impl<'a> PaintContext for MmapImage<'a> { Dimensions { pixel_width, pixel_height, - dpi: 96, + dpi: self.dpi, } }