From 84360f49f2087b884902e99279d8c9959cb73874 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 4 Sep 2006 19:24:51 +0000 Subject: STR 1412: fixed RGB image block copy for ld() values != 0 git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5411 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Image.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx index cd992e9fc..0b844255c 100644 --- a/src/Fl_Image.cxx +++ b/src/Fl_Image.cxx @@ -156,9 +156,19 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) { if (array) { // Make a copy of the image data and return a new Fl_RGB_Image... new_array = new uchar[w() * h() * d()]; - memcpy(new_array, array, w() * h() * d()); - - new_image = new Fl_RGB_Image(new_array, w(), h(), d(), ld()); + if (ld()) { + const uchar *src = array; + uchar *dst = new_array; + int dy, dh = h(), wd = w()*d(), wdld = wd+ld(); + for (dy=0; dyalloc_array = 1; return new_image; -- cgit v1.2.3