Handle image hot spot in wxImage::Rotate180().
Set the hot spot coordinates correctly for the image returned from Rotate180(), just as it's already done by Rotate90(). Closes #12680. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1154,6 +1154,18 @@ wxImage wxImage::Rotate180() const
|
||||
long height = M_IMGDATA->m_height;
|
||||
long width = M_IMGDATA->m_width;
|
||||
|
||||
if ( HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X) )
|
||||
{
|
||||
image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X,
|
||||
width - 1 - GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X));
|
||||
}
|
||||
|
||||
if ( HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y) )
|
||||
{
|
||||
image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y,
|
||||
height - 1 - GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y));
|
||||
}
|
||||
|
||||
const unsigned char *source_data = M_IMGDATA->m_data;
|
||||
unsigned char *target_data = data + width * height * 3;
|
||||
|
||||
|
Reference in New Issue
Block a user