]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/image.cpp
cleanup in toplevel activation, and switching to native carbon event notification...
[wxWidgets.git] / src / common / image.cpp
index 5192bc06d82624615a223c22b73fd72852bd5a86..a5f3c35f484e78acf5247319c01815ec9d5eb02e 100644 (file)
@@ -7,7 +7,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "image.h"
 #endif
 
 #pragma implementation "image.h"
 #endif
 
@@ -219,6 +219,11 @@ wxImage wxImage::Copy() const
 
     memcpy( data, GetData(), M_IMGDATA->m_width*M_IMGDATA->m_height*3 );
 
 
     memcpy( data, GetData(), M_IMGDATA->m_width*M_IMGDATA->m_height*3 );
 
+    // also copy the image options
+    wxImageRefData *imgData = (wxImageRefData *)image.m_refData;
+    imgData->m_optionNames = M_IMGDATA->m_optionNames;
+    imgData->m_optionValues = M_IMGDATA->m_optionValues;
+
     return image;
 }
 
     return image;
 }
 
@@ -303,9 +308,9 @@ wxImage wxImage::ShrinkBy( int xFactor , int yFactor ) const
             }
             else
             {
             }
             else
             {
-                *(target_data++) = avgRed / counter ;
-                *(target_data++) = avgGreen / counter ;
-                *(target_data++) = avgBlue / counter ;
+                *(target_data++) = (unsigned char)(avgRed / counter);
+                *(target_data++) = (unsigned char)(avgGreen / counter);
+                *(target_data++) = (unsigned char)(avgBlue / counter);
             }
         }
     }
             }
         }
     }
@@ -1799,8 +1804,8 @@ wxImage wxImage::Rotate(double angle, const wxPoint & centre_of_rotation, bool i
                                w3 * *(v3++) + w4 * *(v4++)) /
                               (w1 + w2 + w3 + w4) );
                         *(dst++) = (unsigned char)
                                w3 * *(v3++) + w4 * *(v4++)) /
                               (w1 + w2 + w3 + w4) );
                         *(dst++) = (unsigned char)
-                            ( (w1 * *(v1++) + w2 * *(v2++) +
-                               w3 * *(v3++) + w4 * *(v4++)) /
+                            ( (w1 * *v1 + w2 * *v2 +
+                               w3 * *v3 + w4 * *v4) /
                               (w1 + w2 + w3 + w4) );
                     }
                 }
                               (w1 + w2 + w3 + w4) );
                     }
                 }
@@ -1830,7 +1835,7 @@ wxImage wxImage::Rotate(double angle, const wxPoint & centre_of_rotation, bool i
                     unsigned char *p = data[ys] + (3 * xs);
                     *(dst++) = *(p++);
                     *(dst++) = *(p++);
                     unsigned char *p = data[ys] + (3 * xs);
                     *(dst++) = *(p++);
                     *(dst++) = *(p++);
-                    *(dst++) = *(p++);
+                    *(dst++) = *p;
                 }
                 else
                 {
                 }
                 else
                 {