From 42ff24518ba14ed6b11f17bd6a07e9061ee87914 Mon Sep 17 00:00:00 2001 From: Serg Tereshchenko Date: Thu, 15 Jul 2021 14:01:04 +0300 Subject: [PATCH] fix(macos): Fix scaling on mac-os On MacOS points and pixels are the same. --- src/renderer/fonts/caching_shaper.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderer/fonts/caching_shaper.rs b/src/renderer/fonts/caching_shaper.rs index e35cf4d..1f2bb18 100644 --- a/src/renderer/fonts/caching_shaper.rs +++ b/src/renderer/fonts/caching_shaper.rs @@ -326,6 +326,10 @@ fn points_to_pixels(value: f32) -> f32 { // from points to pixels, so this is standard constant values. let pixels_per_inch = 96.0; let points_per_inch = 72.0; + // On macos points == pixels + #[cfg(target_os = "macos")] + let points_per_inch = 96.0; + let pixels_per_point = pixels_per_inch / points_per_inch; value * pixels_per_point