diff --git a/src/Fl_Shared_Image.cxx b/src/Fl_Shared_Image.cxx index 3e099cecf..9b0004b5c 100644 --- a/src/Fl_Shared_Image.cxx +++ b/src/Fl_Shared_Image.cxx @@ -291,7 +291,11 @@ void Fl_Shared_Image::reload() { if (alloc_image_) delete image_; alloc_image_ = 1; - +#if FLTK_ABI_VERSION >= 10304 + image_ = img; + int W = w(); + int H = h(); +#else 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()); @@ -300,8 +304,13 @@ void Fl_Shared_Image::reload() { } else { image_ = img; } - +#endif update(); +#if FLTK_ABI_VERSION >= 10304 + // Make sure the reloaded image gets the same drawing size as the existing one. + if (W) + scale(W, H, 0, 1); +#endif } }