diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2006-09-13 22:55:55 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2006-09-13 22:55:55 +0000 |
| commit | 27217f9a740d690b2c36644c5e7d297604c03231 (patch) | |
| tree | 8435df91d39051b1dba82011c7847be38e6a2810 /src | |
| parent | ef2dc5bd87761e857aa2409de7fae52a85b6aa8c (diff) | |
Fixed Fl_RGB_Image::copy. My previous fix had the meaning of ld() wrong.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5427 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Image.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx index 0b844255c..60e56078a 100644 --- a/src/Fl_Image.cxx +++ b/src/Fl_Image.cxx @@ -156,13 +156,13 @@ 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()]; - if (ld()) { + if (ld() && ld()!=w()*d()) { const uchar *src = array; uchar *dst = new_array; - int dy, dh = h(), wd = w()*d(), wdld = wd+ld(); + int dy, dh = h(), wd = w()*d(), wld = ld(); for (dy=0; dy<dh; dy++) { memcpy(dst, src, wd); - src += wdld; + src += wld; dst += wd; } } else { |
