summaryrefslogtreecommitdiff
path: root/src/Fl_File_Icon2.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2016-10-14 16:35:52 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2016-10-14 16:35:52 +0000
commite3670dfda6799aa92ed30c770dd9c811f4d74b54 (patch)
treecf239d764293f70e6653cbf4827b905af2b65221 /src/Fl_File_Icon2.cxx
parent242d5365e66af53fc936b5ceba5cbcb8b0acf24b (diff)
Fix inconsistent interpretation of ld() in image handling (STR #3308).
Documentation has been fixed and clarified, and ld() handling is now consistent in Fl_(RGB_)Image, their subclasses and fl_draw_image() and similar functions. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12029 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_File_Icon2.cxx')
-rw-r--r--src/Fl_File_Icon2.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Fl_File_Icon2.cxx b/src/Fl_File_Icon2.cxx
index 30f002334..3bd0b9189 100644
--- a/src/Fl_File_Icon2.cxx
+++ b/src/Fl_File_Icon2.cxx
@@ -330,9 +330,10 @@ int Fl_File_Icon::load_image(const char *ifile) // I - File to read from
temp; // Temporary color
const uchar *row; // Pointer into image
+ const int extra_data = img->ld() ? (img->ld()-img->w()*img->d()) : 0;
// Loop through grayscale or RGB image...
- for (y = 0, row = (const uchar *)(*(img->data())); y < img->h(); y ++, row += img->ld())
+ for (y = 0, row = (const uchar *)(*(img->data())); y < img->h(); y ++, row += extra_data)
{
for (x = 0, startx = 0, c = (Fl_Color)-1;
x < img->w();
@@ -404,7 +405,6 @@ int Fl_File_Icon::load_image(const char *ifile) // I - File to read from
int x, y; // X & Y in image
int startx; // Starting X coord
-
// Get the pixmap data...
ptr = img->data();
sscanf(*ptr, "%*d%*d%d%d", &ncolors, &chars_per_color);