Skip to content

Commit

Permalink
Fl_Shared_Image::reload() didn't set the image_ pointer properly
Browse files Browse the repository at this point in the history
in all cases (STR #632)


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3929 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Dec 3, 2004
1 parent 0184365 commit 416ff7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.7

- Fl_Shared_Image::reload() didn't set the image_
pointer properly in all cases (STR #632)
- Fl_Help_View::topline() incorrectly set the changed()
flag (STR #631)
- Fl_Choice::value() now supports NULL or -1 to deselect
Expand Down
9 changes: 5 additions & 4 deletions src/Fl_Shared_Image.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Shared_Image.cxx,v 1.23.2.21 2004/09/24 16:00:11 easysw Exp $"
// "$Id: Fl_Shared_Image.cxx,v 1.23.2.22 2004/12/03 02:51:03 easysw Exp $"
//
// Shared image code for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -245,14 +245,15 @@ Fl_Shared_Image::reload() {
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;
image_ = temp;
} else {
image_ = img;
}

update();
Expand Down Expand Up @@ -460,5 +461,5 @@ Fl_Shared_Image::remove_handler(Fl_Shared_Handler f) {


//
// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.21 2004/09/24 16:00:11 easysw Exp $".
// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.22 2004/12/03 02:51:03 easysw Exp $".
//

0 comments on commit 416ff7f

Please sign in to comment.