| [ Return to Bugs & Features | Roadmap 1.1 | SVN ⇄ GIT ]
STR #632
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 2 - Low, e.g. a documentation error or undocumented side-effect |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Image Support |
Summary: | Fl_Shared_Image::reload does not work proper if image size are changed |
Version: | 1.1.6 |
Created By: | geis.iap.uni-frankfurt |
Assigned To: | mike |
Fix Version: | 1.1.7 |
Update Notification: | |
Trouble Report Files:
No files
Trouble Report Comments:
|
#1 | geis.iap.uni-frankfurt 09:17 Nov 25, 2004 |
| Hello First I would like to say that fltk is a nice GUI Toolkit. But I think I found a small bug in fltk 1.1.6 and older versions in the file Fl_Shered_Image.cxx. The funtion Fl_Shared_Image::reload() seems not to do the right thing.
Juste befor the end of the function there is a "if" statement:
if (img) { if (alloc_image_) delete image_;
image_ = img; alloc_image_ = 1;
if ((img->w() != w() && w()) || (img->h() != h() && h())) { // Make sure the reloaded image is the same size as the existing one. Fl_Image *temp = img->copy(w(), h()); delete img; img = temp; }
update(); }
I think it should be:
if (img) { if (alloc_image_) delete image_;
if ((img->w() != w() && w()) || (img->h() != h() && h())) { // Make sure the reloaded image is the same size as the existing one. Fl_Image *temp = img->copy(w(), h()); delete img; img = temp; } image_ = img; alloc_image_ = 1;
update(); }
because in the first version the image_ member is not set to the right image data if the witdh and the hights of the image are changed in the inner "if" statement. Simple changing the order of the inner "if" statement and the assignement to image_ =img; and setting alloc_imange_=1 after the inner if statement should fix it. Right? Alternativly you can also change only one line: . . delete img; img = temp; . .
to: . . delete img; -> image_ = temp; . . Gunter
| |
|
#2 | mike 18:51 Dec 02, 2004 |
| Fixed in CVS - the anonymous CVS repository will be updated at midnight PST. | |
[ Return to Bugs & Features ]
|
| |