diff options
Diffstat (limited to 'src/Fl_Shared_Image.cxx')
| -rw-r--r-- | src/Fl_Shared_Image.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Fl_Shared_Image.cxx b/src/Fl_Shared_Image.cxx index db73a295c..3b2e874a2 100644 --- a/src/Fl_Shared_Image.cxx +++ b/src/Fl_Shared_Image.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Shared_Image.cxx,v 1.23.2.10 2002/05/25 02:27:20 easysw Exp $" +// "$Id: Fl_Shared_Image.cxx,v 1.23.2.11 2002/05/25 02:56:59 easysw Exp $" // // Shared image code for the Fast Light Tool Kit (FLTK). // @@ -275,6 +275,12 @@ Fl_Shared_Image::copy(int W, int H) { Fl_Image *temp_image; // New image file Fl_Shared_Image *temp_shared; // New shared image + // See if the new and old sizes are the same... + if (image_ && image_->w() == W && image_->h() == H) { + refcount_ ++; + return (this); + } + // Make a copy of the image we're sharing... if (!image_) temp_image = 0; else temp_image = image_->copy(W, H); @@ -287,7 +293,7 @@ Fl_Shared_Image::copy(int W, int H) { temp_shared->refcount_ = 1; temp_shared->image_ = temp_image; - temp_shared->alloc_image_ = 0; + temp_shared->alloc_image_ = 1; temp_shared->update(); @@ -455,5 +461,5 @@ Fl_Shared_Image::remove_handler(Fl_Shared_Handler *f) { // -// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.10 2002/05/25 02:27:20 easysw Exp $". +// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.11 2002/05/25 02:56:59 easysw Exp $". // |
