need to invert offsets for gdk_pixbuf_scale;

remove unneccessary and incorrect optimization


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2007-05-16 07:14:53 +00:00
parent 533b005afd
commit 35d2f1b82e

View File

@@ -304,9 +304,6 @@ wxBitmap wxBitmap::Rescale(int clipx, int clipy, int clipwidth, int clipheight,
wxCHECK_MSG(Ok(), bmp, wxT("invalid bitmap"));
if (newx==M_BMPDATA->m_width && newy==M_BMPDATA->m_height)
return *this;
int width = wxMax(newx, 1);
int height = wxMax(newy, 1);
width = wxMin(width, clipwidth);
@@ -336,7 +333,7 @@ wxBitmap wxBitmap::Rescale(int clipx, int clipy, int clipwidth, int clipheight,
// images, but the only one which preserves sharp edges
gdk_pixbuf_scale(
pixbuf, pixbuf_scaled,
0, 0, width, height, clipx, clipy, scale_x, scale_y,
0, 0, width, height, -clipx, -clipy, scale_x, scale_y,
GDK_INTERP_NEAREST);
g_object_unref(pixbuf);
@@ -353,7 +350,7 @@ wxBitmap wxBitmap::Rescale(int clipx, int clipy, int clipwidth, int clipheight,
gdk_pixbuf_scale(
pixbuf, pixbuf_scaled,
0, 0, width, height, clipx, clipy, scale_x, scale_y,
0, 0, width, height, -clipx, -clipy, scale_x, scale_y,
GDK_INTERP_NEAREST);
g_object_unref(pixbuf);