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:
@@ -304,9 +304,6 @@ wxBitmap wxBitmap::Rescale(int clipx, int clipy, int clipwidth, int clipheight,
|
|||||||
|
|
||||||
wxCHECK_MSG(Ok(), bmp, wxT("invalid bitmap"));
|
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 width = wxMax(newx, 1);
|
||||||
int height = wxMax(newy, 1);
|
int height = wxMax(newy, 1);
|
||||||
width = wxMin(width, clipwidth);
|
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
|
// images, but the only one which preserves sharp edges
|
||||||
gdk_pixbuf_scale(
|
gdk_pixbuf_scale(
|
||||||
pixbuf, pixbuf_scaled,
|
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);
|
GDK_INTERP_NEAREST);
|
||||||
|
|
||||||
g_object_unref(pixbuf);
|
g_object_unref(pixbuf);
|
||||||
@@ -353,7 +350,7 @@ wxBitmap wxBitmap::Rescale(int clipx, int clipy, int clipwidth, int clipheight,
|
|||||||
|
|
||||||
gdk_pixbuf_scale(
|
gdk_pixbuf_scale(
|
||||||
pixbuf, pixbuf_scaled,
|
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);
|
GDK_INTERP_NEAREST);
|
||||||
|
|
||||||
g_object_unref(pixbuf);
|
g_object_unref(pixbuf);
|
||||||
|
Reference in New Issue
Block a user