From 70abac1b8b995dc78ec312eb52f8724161b11b75 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sat, 24 Nov 2001 02:46:19 +0000 Subject: Fix bugs in copy() methods. Add Fl_Shared_Image class, with get() and release() methods. Update Fl_Help_View to use Fl_Shared_Image class. Update image demo to accept a filename, and to use the Fl_Shared_Image class. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1714 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Image.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Fl_Image.cxx') diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx index 909a2a7d5..9a82363d2 100644 --- a/src/Fl_Image.cxx +++ b/src/Fl_Image.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Image.cxx,v 1.5.2.3.2.7 2001/11/23 12:06:36 easysw Exp $" +// "$Id: Fl_Image.cxx,v 1.5.2.3.2.8 2001/11/24 02:46:19 easysw Exp $" // // Image drawing code for the Fast Light Tool Kit (FLTK). // @@ -31,6 +31,7 @@ #include #include + void fl_restore_clip(); // in fl_rect.cxx Fl_Image::~Fl_Image() { @@ -100,8 +101,8 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) { new_image->alloc_array = 1; // Scale the image using a nearest-neighbor algorithm... - for (dy = h(), sy = 0, yerr = H / 2, new_ptr = new_array; dy > 0; dy --) { - for (dx = w(), xerr = W / 2, old_ptr = array + sy * (w() * d() + ld); + for (dy = H, sy = 0, yerr = H / 2, new_ptr = new_array; dy > 0; dy --) { + for (dx = W, xerr = W / 2, old_ptr = array + sy * (w() * d() + ld); dx > 0; dx --) { for (c = 0; c < d(); c ++) *new_ptr++ = old_ptr[c]; @@ -356,5 +357,5 @@ void Fl_RGB_Image::label(Fl_Menu_Item* m) { // -// End of "$Id: Fl_Image.cxx,v 1.5.2.3.2.7 2001/11/23 12:06:36 easysw Exp $". +// End of "$Id: Fl_Image.cxx,v 1.5.2.3.2.8 2001/11/24 02:46:19 easysw Exp $". // -- cgit v1.2.3