Author: manolo
Date: 2012-05-09 09:57:32 -0700 (Wed, 09 May 2012)
New Revision: 9477
Log:
fltk3::GraphicsDriver::copy_offscreen() now expects group-relative coordinates 
for coherence
with other member functions of the same class.

Modified:
   branches/branch-3.0/src/fltk3/DoubleWindow.cxx
   branches/branch-3.0/src/fltk3/Image.cxx
   branches/branch-3.0/src/fltk3/Pixmap.cxx

Modified: branches/branch-3.0/src/fltk3/DoubleWindow.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/DoubleWindow.cxx      2012-05-09 15:30:52 UTC 
(rev 9476)
+++ branches/branch-3.0/src/fltk3/DoubleWindow.cxx      2012-05-09 16:57:32 UTC 
(rev 9477)
@@ -104,14 +104,14 @@
   fl_begin_offscreen(pixmap);
   uchar *img = fltk3::read_image(NULL, srcx, srcy, w, h, 0);
   fl_end_offscreen();
-  fltk3::draw_image(img, x, y, w, h, 3, 0);
+  fltk3::draw_image(img, x+origin_x(), y+origin_y(), w, h, 3, 0);
   delete[] img;
 }
 
 #if defined(USE_X11)
 
 void fltk3::XlibGraphicsDriver::copy_offscreen(int x, int y, int w, int h, 
fltk3::Offscreen pixmap, int srcx, int srcy) {
-  XCopyArea(fl_display, pixmap, fl_window, fl_gc, srcx, srcy, w, h, x, y);
+  XCopyArea(fl_display, pixmap, fl_window, fl_gc, srcx, srcy, w, h, 
x+origin_x(), y+origin_y());
 }
 
 
@@ -186,7 +186,7 @@
   HDC new_gc = CreateCompatibleDC(fl_gc);
   int save = SaveDC(new_gc);
   SelectObject(new_gc, bitmap);
-  BitBlt(fl_gc, x, y, w, h, new_gc, srcx, srcy, SRCCOPY);
+  BitBlt(fl_gc, x+origin_x(), y+origin_y(), w, h, new_gc, srcx, srcy, SRCCOPY);
   RestoreDC(new_gc, save);
   DeleteDC(new_gc);
 }
@@ -200,11 +200,11 @@
   // first try to alpha blend
   // if to printer, always try alpha_blend
   if ( (fltk3::SurfaceDevice::surface() != 
fltk3::DisplayDevice::display_device()) || can_do_alpha_blending() ) {
-    if (fl_alpha_blend) alpha_ok = fl_alpha_blend(fl_gc, x, y, w, h, new_gc, 
srcx, srcy, w, h, blendfunc);
+    if (fl_alpha_blend) alpha_ok = fl_alpha_blend(fl_gc, x+origin_x(), 
y+origin_y(), w, h, new_gc, srcx, srcy, w, h, blendfunc);
   }
   // if that failed (it shouldn't), still copy the bitmap over, but now alpha 
is 1
   if (!alpha_ok) {
-    BitBlt(fl_gc, x, y, w, h, new_gc, srcx, srcy, SRCCOPY);
+    BitBlt(fl_gc, x+origin_x(), y+origin_y(), w, h, new_gc, srcx, srcy, 
SRCCOPY);
   }
   RestoreDC(new_gc, save);
   DeleteDC(new_gc);
@@ -264,7 +264,7 @@
   CGDataProviderRef src_bytes = CGDataProviderCreateWithData( src, data, 
sw*sh*4, bmProviderRelease);
   CGImageRef img = CGImageCreate( sw, sh, 8, 4*8, 4*sw, lut, alpha,
                                 src_bytes, 0L, false, 
kCGRenderingIntentDefault);
-  CGRect rect = { { x, y }, { w, h } };
+  CGRect rect = { { x+origin_x(), y+origin_y() }, { w, h } };
   Fl_X::q_begin_image(rect, srcx, srcy, sw, sh);
   CGContextDrawImage(fl_gc, rect, img);
   Fl_X::q_end_image();

Modified: branches/branch-3.0/src/fltk3/Image.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Image.cxx     2012-05-09 15:30:52 UTC (rev 
9476)
+++ branches/branch-3.0/src/fltk3/Image.cxx     2012-05-09 16:57:32 UTC (rev 
9477)
@@ -543,9 +543,9 @@
     RestoreDC(new_gc,save);
     DeleteDC(new_gc);
   } else if (img->d()==2 || img->d()==4) {
-    copy_offscreen_with_alpha(X+origin_x(), Y+origin_y(), W, H, 
(fltk3::Offscreen)img->id_, cx, cy);
+    copy_offscreen_with_alpha(X, Y, W, H, (fltk3::Offscreen)img->id_, cx, cy);
   } else {
-    copy_offscreen(X+origin_x(), Y+origin_y(), W, H, 
(fltk3::Offscreen)img->id_, cx, cy);
+    copy_offscreen(X, Y, W, H, (fltk3::Offscreen)img->id_, cx, cy);
   }
 }
 
@@ -582,7 +582,7 @@
       XSetClipOrigin(fl_display, fl_gc, X-cx, Y-cy);
     }
     
-    copy_offscreen(X+origin_x(), Y+origin_y(), W, H, img->id_, cx, cy);
+    copy_offscreen(X, Y, W, H, img->id_, cx, cy);
     
     if (img->mask_) {
       // put the old clip region back

Modified: branches/branch-3.0/src/fltk3/Pixmap.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Pixmap.cxx    2012-05-09 15:30:52 UTC (rev 
9476)
+++ branches/branch-3.0/src/fltk3/Pixmap.cxx    2012-05-09 16:57:32 UTC (rev 
9477)
@@ -144,7 +144,7 @@
 void fltk3::QuartzGraphicsDriver::draw(fltk3::Pixmap *pxm, int XP, int YP, int 
WP, int HP, int cx, int cy) {
   int X, Y, W, H;
   if (pxm->prepare(XP, YP, WP, HP, cx, cy, X, Y, W, H)) return;
-  copy_offscreen(X+origin_x(), Y+origin_y(), W, H, (fltk3::Offscreen)pxm->id_, 
cx, cy);
+  copy_offscreen(X, Y, W, H, (fltk3::Offscreen)pxm->id_, cx, cy);
 }
 
 #elif defined(WIN32)
@@ -162,7 +162,7 @@
     RestoreDC(new_gc,save);
     DeleteDC(new_gc);
   } else {
-    copy_offscreen(X+origin_x(), Y+origin_y(), W, H, 
(fltk3::Offscreen)pxm->id_, cx, cy);
+    copy_offscreen(X, Y, W, H, (fltk3::Offscreen)pxm->id_, cx, cy);
   }
 }
 
@@ -186,7 +186,7 @@
     DeleteDC(new_gc);
   }
   else {
-    copy_offscreen(X+origin_x(), Y+origin_y(), W, H, 
(fltk3::Offscreen)pxm->id_, cx, cy);
+    copy_offscreen(X, Y, W, H, (fltk3::Offscreen)pxm->id_, cx, cy);
   }
 }
 
@@ -206,7 +206,7 @@
     int oy = Y-cy; if (oy < 0) oy += pxm->h();
     XSetClipOrigin(fl_display, fl_gc, X+origin_x()-cx, Y+origin_y()-cy);
   }
-  copy_offscreen(X+origin_x(), Y+origin_y(), W, H, pxm->id_, cx, cy);
+  copy_offscreen(X, Y, W, H, pxm->id_, cx, cy);
   if (pxm->mask_) {
     // put the old clip region back
     XSetClipOrigin(fl_display, fl_gc, 0, 0);

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

Reply via email to