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/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm | |
| 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/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm')
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm b/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm index 38c3075c5..607aed8fc 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm +++ b/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm @@ -19,6 +19,7 @@ #include <FL/Fl_Printer.H> #include <FL/Fl_Shared_Image.H> #include <FL/Fl_Window_Driver.H> +#include <FL/Fl_Screen_Driver.H> #include "../Quartz/Fl_Quartz_Graphics_Driver.H" #include "../Darwin/Fl_Darwin_System_Driver.H" #include "Fl_Cocoa_Window_Driver.H" @@ -401,8 +402,9 @@ void Fl_Cocoa_Printer_Driver::draw_decorated_window(Fl_Window *win, int x_offset CGContextRef gc = (CGContextRef)driver()->gc(); CGContextSaveGState(gc); CGContextTranslateCTM(gc, x_offset - 0.5, y_offset + bt - 0.5); - CGContextScaleCTM(gc, 1, -1); - Fl_Cocoa_Window_Driver::draw_layer_to_context(layer, gc, win->w(), bt); + float s = Fl::screen_driver()->scale(win->driver()->screen_num()); + CGContextScaleCTM(gc, 1/s, -1/s); + Fl_Cocoa_Window_Driver::draw_layer_to_context(layer, gc, win->w() * s, bt); CGContextRestoreGState(gc); } else { |
