From 6a32252403781b303d4ebd195932ce39c5b1c08e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 30 Jul 2019 16:03:58 +0200 Subject: Update to 5.43 --- jwxyz/jwxyz-cocoa.m | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'jwxyz/jwxyz-cocoa.m') diff --git a/jwxyz/jwxyz-cocoa.m b/jwxyz/jwxyz-cocoa.m index 96d54b8..13666e7 100644 --- a/jwxyz/jwxyz-cocoa.m +++ b/jwxyz/jwxyz-cocoa.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1991-2018 Jamie Zawinski +/* xscreensaver, Copyright (c) 1991-2019 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -94,8 +94,8 @@ jwxyz_drawable_depth (Drawable d) } -float -jwxyz_scale (Window main_window) +static float +jwxyz_scale_1 (Window main_window, BOOL fonts_p) { float scale = 1; @@ -108,20 +108,32 @@ jwxyz_scale (Window main_window) or so, even if the display has significantly higher resolution. That is unrelated to this hack, which is really about DPI. */ - scale = main_window->window.view.hackedContentScaleFactor; + scale = [main_window->window.view hackedContentScaleFactor:fonts_p]; if (scale < 1) // iPad Pro magnifies the backbuffer by 3x, which makes text scale = 1; // excessively blurry in BSOD. # else // !USE_IPHONE /* Desktop retina displays also need fonts doubled. */ - scale = main_window->window.view.hackedContentScaleFactor; + scale = [main_window->window.view hackedContentScaleFactor:fonts_p]; # endif // !USE_IPHONE return scale; } +float +jwxyz_scale (Window main_window) +{ + return jwxyz_scale_1 (main_window, FALSE); +} + +static float +jwxyz_font_scale (Window main_window) +{ + return jwxyz_scale_1 (main_window, TRUE); +} + /* Font metric terminology, as used by X11: @@ -421,7 +433,7 @@ jwxyz_load_native_font (Window main_window, int traits_jwxyz, int mask_jwxyz, encoding:NSUTF8StringEncoding] : nil; - size *= jwxyz_scale (main_window); + size *= jwxyz_font_scale (main_window); if (font_name_type == JWXYZ_FONT_RANDOM) { -- cgit v1.2.3-55-g7522