From 75b4a349c630b07fe461df7b647f3e907dc207dd Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Fri, 13 Feb 2015 12:00:19 +0000 Subject: Mac OS: made function Fl_Graphics_Driver::clip_box() more accurate for retina displays git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10576 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/fl_rect.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx index f7a49cb7c..ff217db34 100644 --- a/src/fl_rect.cxx +++ b/src/fl_rect.cxx @@ -718,10 +718,10 @@ int Fl_Graphics_Driver::clip_box(int x, int y, int w, int h, int& X, int& Y, int else u = CGRectUnion(u, test); } } - X = int(u.origin.x); - Y = int(u.origin.y); - W = int(u.size.width + 1); - H = int(u.size.height + 1); + X = int(u.origin.x + 0.5); // reverse offset introduced by fl_cgrectmake_cocoa() + Y = int(u.origin.y + 0.5); + W = int(u.size.width + 0.5); // round to nearest integer + H = int(u.size.height + 0.5); if(CGRectIsEmpty(u)) W = H = 0; return ! CGRectEqualToRect(arg, u); #else -- cgit v1.2.3