X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e0a76d8d8a91d5a13c1fab7257aae4da8311f58d..4a09bc4e34a16a5a608d7ae1dca60d29a1765f19:/src/common/image.cpp diff --git a/src/common/image.cpp b/src/common/image.cpp index 48b39581f5..2c5ba9758d 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -275,6 +275,14 @@ wxImage wxImage::Scale( int width, int height ) const } #endif + // In case this is a cursor, make sure the hotspot is scalled accordingly: + if ( HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X) ) + image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, + (GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X)*width)/old_width); + if ( HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ) + image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, + (GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y)*height)/old_height); + return image; } @@ -933,6 +941,8 @@ bool wxImage::LoadFile( const wxString& filename, const wxString& mimetype, int bool wxImage::SaveFile( const wxString& filename, int type ) const { #if wxUSE_STREAMS + ((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename); + wxFileOutputStream stream(filename); if ( stream.LastError() == wxStream_NOERROR ) @@ -948,6 +958,8 @@ bool wxImage::SaveFile( const wxString& filename, int type ) const bool wxImage::SaveFile( const wxString& filename, const wxString& mimetype ) const { #if wxUSE_STREAMS + ((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename); + wxFileOutputStream stream(filename); if ( stream.LastError() == wxStream_NOERROR )