Author: matt
Date: 2012-05-02 14:55:05 -0700 (Wed, 02 May 2012)
New Revision: 9438
Log:
Fixed RGB image drawing for OS X
Modified:
branches/branch-3.0/src/fltk3/Image.cxx
branches/branch-3.0/test/color_chooser.cxx
Modified: branches/branch-3.0/src/fltk3/Image.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Image.cxx 2012-05-02 21:40:56 UTC (rev
9437)
+++ branches/branch-3.0/src/fltk3/Image.cxx 2012-05-02 21:55:05 UTC (rev
9438)
@@ -500,7 +500,7 @@
CGDataProviderRelease(src);
}
if (img->id_ && fl_gc) {
- CGRect rect = { { X, Y }, { W, H } };
+ CGRect rect = { { X+origin_x(), Y+origin_y() }, { W, H } };
Fl_X::q_begin_image(rect, cx, cy, img->w(), img->h());
CGContextDrawImage(fl_gc, rect, (CGImageRef)img->id_);
Fl_X::q_end_image();
Modified: branches/branch-3.0/test/color_chooser.cxx
===================================================================
--- branches/branch-3.0/test/color_chooser.cxx 2012-05-02 21:40:56 UTC (rev
9437)
+++ branches/branch-3.0/test/color_chooser.cxx 2012-05-02 21:55:05 UTC (rev
9438)
@@ -65,11 +65,12 @@
Pens(int X, int Y, int W, int H, const char* L)
: fltk3::Box(X,Y,W,H,L) {}
};
+
void Pens::draw() {
// use every color in the gray ramp:
for (int i = 0; i < 3*8; i++) {
fltk3::color((fltk3::Color)(fltk3::GRAY_RAMP+i));
- fltk3::line(x()+i, y(), x()+i, y()+h());
+ fltk3::line(i, 0, i, h());
}
}
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit