diff options
| author | Manolo Gouy <Manolo> | 2018-05-04 08:25:45 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-05-04 08:25:45 +0000 |
| commit | d4eeb75ac6829e663996e87c3584e247d10eead8 (patch) | |
| tree | bfee6c9d7c45464e429b6211abff6d6d7fa959f8 | |
| parent | 7ef645a91fe57f09d4ff1111395e4c27b7397d31 (diff) | |
MacOS: improve fl_overlay_rect() when GUI scale factor = 1.7
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12893 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_cocoa.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index da0ccb14d..7cac1b1ef 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -4198,9 +4198,10 @@ static NSBitmapImageRep* rect_to_NSBitmapImageRep(Fl_Window *win, int x, int y, rect = NSMakeRect(s*x - 0.5, s*y - 0.5, s*w, s*h); } else { - rect = NSMakeRect(x*s, int(win->h()*s)-(y+h)*s, w*s, h*s); - // lock focus to win's view winview = [fl_xid(win) contentView]; + int view_h = [winview frame].size.height; + rect = NSMakeRect(int(x*s), int(view_h-y*s-int(h*s)), int(w*s), int(h*s)); + // lock focus to win's view #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 if (fl_mac_os_version >= 101100) [[fl_xid(win) graphicsContext] saveGraphicsState]; // necessary under 10.11 #endif |
