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
This commit is contained in:
Manolo Gouy 2015-02-13 12:00:19 +00:00
parent 15b8e2eb87
commit 75b4a349c6

View File

@ -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