summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-05-21 21:17:11 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-05-21 21:17:11 +0200
commit9b80a38345d2197654c4610f3d3812e27a301c36 (patch)
tree64e61aa88d8c5d872f03eff60e28592d3e9938da /src/Fl_cocoa.mm
parent07f4fd43802183721e3e69f2d828af5f5820ea5a (diff)
Support for fl_scroll() under macOS when GUI is scaled
Diffstat (limited to 'src/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index f7365630b..3b4af18e4 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -3408,9 +3408,9 @@ void Fl_Cocoa_Window_Driver::make_current()
// it gets activated when needed (e.g., draw text)
CGContextSetShouldAntialias(gc, false);
CGFloat hgt = [[fl_window contentView] frame].size.height;
- CGContextTranslateCTM(gc, 0.5, hgt-0.5f);
- CGContextScaleCTM(gc, 1.0f, -1.0f); // now 0,0 is top-left point of the window
float s = Fl::screen_driver()->scale(0);
+ CGContextTranslateCTM(gc, 0.5f*s, hgt-0.5f*s);
+ CGContextScaleCTM(gc, 1.0f, -1.0f); // now 0,0 is top-left point of the window
CGContextScaleCTM(gc, s, s); // apply current scaling factor
// for subwindows, limit drawing to inside of parent window
// half pixel offset is necessary for clipping as done by fl_cgrectmake_cocoa()