FLTK logo

[master] d30e4aa - Fix use of FLTK_SCALING_FACTOR under macOS

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] d30e4aa - Fix use of FLTK_SCALING_FACTOR under macOS "ManoloFLTK" 09:32 Mar 12  
 
commit d30e4aa0af9d21f8b58ccd04f63f529ffcaf6add
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Tue Mar 12 17:29:29 2024 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Tue Mar 12 17:29:29 2024 +0100

    Fix use of FLTK_SCALING_FACTOR under macOS

 src/Fl_Screen_Driver.cxx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git src/Fl_Screen_Driver.cxx src/Fl_Screen_Driver.cxx
index f975195..2956b7b 100644
--- src/Fl_Screen_Driver.cxx
+++ src/Fl_Screen_Driver.cxx
@@ -564,7 +564,12 @@ void Fl_Screen_Driver::use_startup_scale_factor()
   if ((p = fl_getenv("FLTK_SCALING_FACTOR"))) {
     float factor = 1;
     sscanf(p, "%f", &factor);
-    for (int i = 0; i < s_count; i++)  scale(i, factor * scale(i));
+    if (rescalable() == SYSTEMWIDE_APP_SCALING) {
+      float new_val = factor * scale(0);
+      for (int i = 0; i < s_count; i++)  scale(i, new_val);
+    } else {
+      for (int i = 0; i < s_count; i++)  scale(i, factor * scale(i));
+    }
   }
 }
 
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.