X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/46132182f033f8e24e89036b6111fa470bb4abb0..9453a61bd887cb6a9a5c08e80af2eba072516663:/src/common/image.cpp diff --git a/src/common/image.cpp b/src/common/image.cpp index ac99956336..e9435b5a46 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -2749,18 +2749,18 @@ wxImage wxImage::Rotate(double angle, const wxPoint & centre_of_rotation, bool i // First, find rectangle that covers the rotated image; to do that, // rotate the four corners - const wxRotationPoint & p0 = centre_of_rotation; + const wxRotationPoint p0 = centre_of_rotation; wxRotationPoint p1 = rotated_point (0, 0, cos_angle, sin_angle, p0); wxRotationPoint p2 = rotated_point (0, img.GetHeight(), cos_angle, sin_angle, p0); wxRotationPoint p3 = rotated_point (img.GetWidth(), 0, cos_angle, sin_angle, p0); wxRotationPoint p4 = rotated_point (img.GetWidth(), img.GetHeight(), cos_angle, sin_angle, p0); - int x1 = floor (wxMin (wxMin(p1.x, p2.x), wxMin(p3.x, p4.x))); - int y1 = floor (wxMin (wxMin(p1.y, p2.y), wxMin(p3.y, p4.y))); + int x1 = (int) floor (wxMin (wxMin(p1.x, p2.x), wxMin(p3.x, p4.x))); + int y1 = (int) floor (wxMin (wxMin(p1.y, p2.y), wxMin(p3.y, p4.y))); - int x2 = ceil (wxMax (wxMax(p1.x, p2.x), wxMax(p3.x, p4.x))); - int y2 = ceil (wxMax (wxMax(p1.y, p2.y), wxMax(p3.y, p4.y))); + int x2 = (int) ceil (wxMax (wxMax(p1.x, p2.x), wxMax(p3.x, p4.x))); + int y2 = (int) ceil (wxMax (wxMax(p1.y, p2.y), wxMax(p3.y, p4.y))); wxImage rotated (x2 - x1 + 1, y2 - y1 + 1); @@ -2841,7 +2841,7 @@ wxImage wxImage::Rotate(double angle, const wxPoint & centre_of_rotation, bool i else { // weights for the weighted average are proportional to the inverse of the distance - const w1 = 1/d1, w2 = 1/d2, w3 = 1/d3, w4 = 1/d4; + const double w1 = 1/d1, w2 = 1/d2, w3 = 1/d3, w4 = 1/d4; for (int i = 0; i < 3; i++) // repeat calculation for R, G, and B { @@ -2859,8 +2859,8 @@ wxImage wxImage::Rotate(double angle, const wxPoint & centre_of_rotation, bool i } else { - const int & xs = wxCint (src.x); // wxCint performs rounding to the - const int & ys = wxCint (src.y); // closest integer + const int xs = wxCint (src.x); // wxCint performs rounding to the + const int ys = wxCint (src.y); // closest integer if (0 <= xs && xs < img.GetWidth() && 0 <= ys && ys < img.GetHeight())