summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_Shared_Image.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/Fl_Shared_Image.cxx b/src/Fl_Shared_Image.cxx
index e0bb524ad..832d8a3a0 100644
--- a/src/Fl_Shared_Image.cxx
+++ b/src/Fl_Shared_Image.cxx
@@ -280,17 +280,13 @@ void Fl_Shared_Image::reload() {
if (alloc_image_) delete image_;
alloc_image_ = 1;
-
- if ((img->w() != data_w() && data_w()) || (img->h() != data_h() && data_h())) {
- // Make sure the reloaded image is the same size as the existing one.
- Fl_Image *temp = img->copy(data_w(), data_h());
- delete img;
- image_ = temp;
- } else {
- image_ = img;
- }
-
+ image_ = img;
+ int W = w();
+ int H = h();
update();
+ // Make sure the reloaded image gets the same drawing size as the existing one.
+ if (W)
+ scale(W, H, 0, 1);
}
}