Author: manolo
Date: 2011-09-19 12:17:37 -0700 (Mon, 19 Sep 2011)
New Revision: 9051
Log:
Mac OS: simplified use of CGRectMake() for rectangle drawing and clipping on 
display and printer.

Modified:
   branches/branch-3.0/src/fltk3/cocoa.mm
   branches/branch-3.0/src/fltk3/rect.cxx

Modified: branches/branch-3.0/src/fltk3/cocoa.mm
===================================================================
--- branches/branch-3.0/src/fltk3/cocoa.mm      2011-09-19 19:03:22 UTC (rev 
9050)
+++ branches/branch-3.0/src/fltk3/cocoa.mm      2011-09-19 19:17:37 UTC (rev 
9051)
@@ -3350,8 +3350,9 @@
 
 // so a CGRect matches exactly what is denoted x,y,w,h for clipping purposes
 CGRect fl_cgrectmake_cocoa(int x, int y, int w, int h) {
-  if (fltk3::SurfaceDevice::surface()->class_name() == 
fltk3::Printer::class_id) return CGRectMake(x-0.5, y-0.5, w, h); 
-  return CGRectMake(x, y, w > 0 ? w - 0.9 : 0, h > 0 ? h - 0.9 : 0);
+  /*if (fltk3::SurfaceDevice::surface()->class_name() == 
fltk3::Printer::class_id) return CGRectMake(x-0.5, y-0.5, w, h); 
+  return CGRectMake(x, y, w > 0 ? w - 0.9 : 0, h > 0 ? h - 0.9 : 0);*/
+  return CGRectMake(x, y, w - 1, h - 1);
 }
 
 Window fl_xid(const fltk3::Window* w)

Modified: branches/branch-3.0/src/fltk3/rect.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/rect.cxx      2011-09-19 19:03:22 UTC (rev 
9050)
+++ branches/branch-3.0/src/fltk3/rect.cxx      2011-09-19 19:17:37 UTC (rev 
9051)
@@ -197,13 +197,14 @@
   rect.right = x + w; rect.bottom = y + h;
   FillRect(fl_gc, &rect, fl_brush());
 #elif defined(__APPLE_QUARTZ__)
-  CGFloat delta_size =  0.9;
+  /*CGFloat delta_size =  0.9;
   CGFloat delta_ori = 0;
   if (USINGQUARTZPRINTER) {
     delta_size = 0;
     delta_ori = 0.5;
     }
-  CGRect  rect = CGRectMake(x - delta_ori, y - delta_ori, w - delta_size , h - 
delta_size);
+  CGRect  rect = CGRectMake(x - delta_ori, y - delta_ori, w - delta_size , h - 
delta_size);*/
+  CGRect rect = CGRectMake(x, y, w-1, h-1);
   CGContextFillRect(fl_gc, rect);
 #else
 # error unsupported platform

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to