]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/image.cpp
Always send an erase event to satisfy some users...
[wxWidgets.git] / src / common / image.cpp
index 48b39581f5a6a69f1d13687d93e268061fb44db7..2c5ba9758dba4cba2f67e9c89d21e398b1b4ca46 100644 (file)
@@ -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 )