summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2010-01-29 21:16:20 +0000
committerManolo Gouy <Manolo>2010-01-29 21:16:20 +0000
commit4645ed97031bb2ce1122ec890a6c6ac55590c94a (patch)
treedac195e42bb3183ae1626f8c00f3af0a9515480d /src
parent7f518b9287269190f63d4bb3d6933624308ffecd (diff)
defined macro FL_CGRECTMAKE_COCOA that
contains the correct way to transform x,y,w,h into a CGRect adequate for clipping git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7035 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl.cxx4
-rw-r--r--src/Fl_cocoa.mm8
-rw-r--r--src/fl_rect.cxx4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 17d4c5612..c8b359c6b 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1474,8 +1474,8 @@ void Fl_Widget::damage(uchar fl, int X, int Y, int W, int H) {
XDestroyRegion(R);
#elif defined(__APPLE_QUARTZ__)
#ifdef __APPLE_COCOA__
- CGRect arg = CGRectMake(X, Y, W - 0.9, H - 0.9);
- int j;//don't add a rectangle totally inside the Fl_Region
+ CGRect arg = FL_CGRECTMAKE_COCOA(X, Y, W, H);
+ int j; // don't add a rectangle totally inside the Fl_Region
for(j = 0; j < i->region->count; j++) {
if(CGRectContainsRect(i->region->rects[j], arg)) break;
}
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index ce4cacd1d..bd950ebef 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -99,7 +99,7 @@ extern CGContextRef CreateNoneImage(void);
// converting cr lf converter function
static void convert_crlf(char * string, size_t len);
static void createAppleMenu(void);
-Fl_Region MacRegionMinusRect(Fl_Region r, int x,int y,int w,int h);
+static Fl_Region MacRegionMinusRect(Fl_Region r, int x,int y,int w,int h);
static void cocoaMouseHandler(NSEvent *theEvent);
// public variables
@@ -2620,14 +2620,14 @@ void MacUnmapWindow(Fl_Window *w, void *p) {
MacUnlinkWindow(Fl_X::i(w));
}
-Fl_Region MacRegionMinusRect(Fl_Region r, int x,int y,int w,int h)
+static Fl_Region MacRegionMinusRect(Fl_Region r, int x,int y,int w,int h)
/* removes x,y,w,h rectangle from region r and returns result as a new Fl_Region
*/
{
Fl_Region outr = (Fl_Region)malloc(sizeof(*outr));
outr->rects = (CGRect*)malloc(4 * r->count * sizeof(CGRect));
outr->count = 0;
- CGRect rect = CGRectMake(x,y,w - 0.9,h - 0.9);
+ CGRect rect = FL_CGRECTMAKE_COCOA(x, y, w, h);
for( int i = 0; i < r->count; i++) {
CGRect A = r->rects[i];
CGRect test = CGRectIntersection(A, rect);
@@ -2672,7 +2672,7 @@ Fl_Region MacRectRegionIntersect(Fl_Region current, int x,int y,int w, int h)
*/
{
if (current == NULL) return XRectangleRegion(x,y,w,h);
- CGRect r = CGRectMake(x, y, w - 0.9, h - 0.9);
+ CGRect r = FL_CGRECTMAKE_COCOA(x, y, w, h);
Fl_Region outr = (Fl_Region)malloc(sizeof(*outr));
outr->count = current->count;
outr->rects =(CGRect*)malloc(outr->count * sizeof(CGRect));
diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx
index 5061561b1..c0696559c 100644
--- a/src/fl_rect.cxx
+++ b/src/fl_rect.cxx
@@ -747,7 +747,7 @@ 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 - 0.9, h - 0.9);
+ CGRect arg = FL_CGRECTMAKE_COCOA(x, y, w, h);
for(int i = 0; i < r->count; i++) {
CGRect test = CGRectIntersection(r->rects[i], arg);
if( ! CGRectIsEmpty(test)) return 1;
@@ -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 - 0.9, h - 0.9);
+ CGRect arg = FL_CGRECTMAKE_COCOA(x, y, w, h);
CGRect u = CGRectMake(0,0,0,0);
CGRect test;
for(int i = 0; i < r->count; i++) {