From 46d8ef2c1d60ef5462a1a8b263dfe218b6288a64 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sun, 7 Jan 2018 18:16:52 +0000 Subject: MacOS: More accurate coordinate computation in rect_to_NSBitmapImageRep() when GUI is rescaled. The modified statement uses the window height in graphics coordinates that has been truncated to integer at window creation and resize. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12625 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 64363af41..f8ff28004 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -4190,7 +4190,7 @@ 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, win->h()*s-(y+h)*s, w*s, h*s); + 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]; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 -- cgit v1.2.3