diff options
| author | Manolo Gouy <Manolo> | 2015-02-13 12:00:19 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2015-02-13 12:00:19 +0000 |
| commit | 75b4a349c630b07fe461df7b647f3e907dc207dd (patch) | |
| tree | 16e561a02b697ab03426d353eeda3a992dc43934 | |
| parent | 15b8e2eb87c9f902471e9917bbd409783e6de238 (diff) | |
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
| -rw-r--r-- | src/fl_rect.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
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 |
