Partial fix for issue #188.

This fixes the inconsistency created by the possibility to change img->w() and img->h()
values. The fix is to use img->data_w() and img->data_h() that have constant values.
This commit is contained in:
ManoloFLTK 2021-03-15 15:11:56 +01:00
parent a620ef5b37
commit a4866ffc21

View File

@ -101,10 +101,10 @@ Fl_Shared_Image::compare(Fl_Shared_Image **i0, // I - First image
int i = strcmp((*i0)->name(), (*i1)->name()); int i = strcmp((*i0)->name(), (*i1)->name());
if (i) return i; if (i) return i;
else if (((*i0)->w() == 0 && (*i1)->original_) || else if (((*i0)->data_w() == 0 && (*i1)->original_) ||
((*i1)->w() == 0 && (*i0)->original_)) return 0; ((*i1)->data_w() == 0 && (*i0)->original_)) return 0;
else if ((*i0)->w() != (*i1)->w()) return (*i0)->w() - (*i1)->w(); else if ((*i0)->data_w() != (*i1)->data_w()) return (*i0)->data_w() - (*i1)->data_w();
else return (*i0)->h() - (*i1)->h(); else return (*i0)->data_h() - (*i1)->data_h();
} }