diff options
| author | Manolo Gouy <Manolo> | 2017-12-18 08:52:55 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2017-12-18 08:52:55 +0000 |
| commit | 3f9f4debbba0527658ce09044fbff90e332235cc (patch) | |
| tree | a3a4852ab786012432666a1fe07fdca9f05387dc /src/Fl_Gl_Window.cxx | |
| parent | 31f16205cb31d724ee93444f5b9b17e7fa3ae3b1 (diff) | |
STR#3444: Add MacOS support for application rescaling (not quite complete)
With this, most MacOS FLTK app can be scaled with command/+/-/0/ keystrokes.
A scaling problem remains, visible in test/cube, where the "Test" string is not positioned correctly.
GLUT apps can also be scaled (across platforms).
SVG images are re-rasterized after app scaling for optimal drawing.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12594 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Gl_Window.cxx')
| -rw-r--r-- | src/Fl_Gl_Window.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index 426fd582e..c95220ce5 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -25,6 +25,7 @@ extern int fl_gl_load_plugin; #include <FL/Fl_Gl_Window.H> #include <FL/Fl_Gl_Window_Driver.H> #include <FL/Fl_Window_Driver.H> +#include <FL/Fl_Graphics_Driver.H> #include <stdlib.h> #include <FL/fl_utf8.h> # if (HAVE_DLSYM && HAVE_DLFCN_H) @@ -516,8 +517,9 @@ void Fl_Cocoa_Gl_Window_Driver::after_show(int need_redraw) { float Fl_Cocoa_Gl_Window_Driver::pixels_per_unit() { - return (fl_mac_os_version >= 100700 && Fl::use_high_res_GL() && Fl_X::i(pWindow) && + int retina = (fl_mac_os_version >= 100700 && Fl::use_high_res_GL() && Fl_X::i(pWindow) && Fl_Cocoa_Window_Driver::driver(pWindow)->mapped_to_retina()) ? 2 : 1; + return retina * Fl_Graphics_Driver::default_driver().scale(); } int Fl_Cocoa_Gl_Window_Driver::mode_(int m, const int *a) { |
