diff options
| author | Manolo Gouy <Manolo> | 2010-01-24 10:27:21 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2010-01-24 10:27:21 +0000 |
| commit | 1eb95cd823c973975d4bdff1c74571d1ea657372 (patch) | |
| tree | 7c8e9a9c2f75d6421820ddf04de4c68985ea77f8 /src/fl_rect.cxx | |
| parent | 6f89a3baca6ddc563e26ffca17c35adcc9f41f1b (diff) | |
Three Cocoa-related changes:
- correct window resize in mandelbrot demo
- clip to 1-pixel and 0-pixel width now work
- modifier key presses are now correctly reported
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7029 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_rect.cxx')
| -rw-r--r-- | src/fl_rect.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx index 0709f2ff9..5061561b1 100644 --- a/src/fl_rect.cxx +++ b/src/fl_rect.cxx @@ -684,10 +684,10 @@ void fl_push_clip(int x, int y, int w, int h) { r = CreateRectRgn(0,0,0,0); #elif defined(__APPLE_QUARTZ__) #ifdef __APPLE_COCOA__ - r = NULL; + r = XRectangleRegion(0,0,0,0); #else - r = NewRgn(); - SetEmptyRgn(r); + r = NewRgn(); + SetEmptyRgn(r); #endif #else # error unsupported platform @@ -747,12 +747,12 @@ int fl_not_clipped(int x, int y, int w, int h) { #elif defined(__APPLE_QUARTZ__) if (!r) return 1; #ifdef __APPLE_COCOA__ - CGRect arg = CGRectMake(x,y,w - 1,h - 1); - for(int i = 0; i < r->count; i++) { - CGRect test = CGRectIntersection(r->rects[i], arg); - if( ! CGRectIsEmpty(test)) return 1; - } - return 0; + CGRect arg = CGRectMake(x, y, w - 0.9, h - 0.9); + for(int i = 0; i < r->count; i++) { + CGRect test = CGRectIntersection(r->rects[i], arg); + if( ! CGRectIsEmpty(test)) return 1; + } + return 0; #else Rect rect; rect.left = x; rect.top = y; rect.right = x+w; rect.bottom = y+h; @@ -825,7 +825,7 @@ int fl_clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H){ return ret; #elif defined(__APPLE_QUARTZ__) #ifdef __APPLE_COCOA__ - CGRect arg = CGRectMake(x,y,w - 1,h - 1); + CGRect arg = CGRectMake(x, y, w - 0.9, h - 0.9); CGRect u = CGRectMake(0,0,0,0); CGRect test; for(int i = 0; i < r->count; i++) { @@ -837,8 +837,8 @@ int fl_clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H){ } X = u.origin.x; Y = u.origin.y; - W = u.size.width; - H = u.size.height; + W = u.size.width + 1; + H = u.size.height + 1; if(CGRectIsEmpty(u)) W = H = 0; return ! CGRectEqualToRect(arg, u); #else |
