aegisub: ifdef wxBitmap constructor to scale on MacOS only

Quick fix to unblock the build; need better HiDPI handling across the board
This commit is contained in:
Ryan 2021-01-16 13:01:51 -05:00
parent b42da504a0
commit b8d1864a07
2 changed files with 6 additions and 0 deletions

View file

@ -131,6 +131,7 @@ else
'-DwxBUILD_SHARED=@0@'.format(build_shared), '-DwxBUILD_SHARED=@0@'.format(build_shared),
'-DwxUSE_WEBVIEW=OFF', # breaks build on linux '-DwxUSE_WEBVIEW=OFF', # breaks build on linux
'-DCMAKE_BUILD_TYPE=@0@'.format(build_type), '-DCMAKE_BUILD_TYPE=@0@'.format(build_type),
'-DwxUSE_IMAGE=ON',
'-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson '-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson
deps += [ deps += [
wx.dependency('wxmono'), wx.dependency('wxmono'),

View file

@ -23,8 +23,13 @@
wxBitmap libresrc_getimage(const unsigned char *buff, size_t size, double scale, int dir) { wxBitmap libresrc_getimage(const unsigned char *buff, size_t size, double scale, int dir) {
wxMemoryInputStream mem(buff, size); wxMemoryInputStream mem(buff, size);
if (dir != wxLayout_RightToLeft) if (dir != wxLayout_RightToLeft)
#ifdef __WXMAC__
return wxBitmap(wxImage(mem), -1, scale); return wxBitmap(wxImage(mem), -1, scale);
return wxBitmap(wxImage(mem).Mirror(), -1, scale); return wxBitmap(wxImage(mem).Mirror(), -1, scale);
#else
return wxBitmap(wxImage(mem));
return wxBitmap(wxImage(mem).Mirror());
#endif
} }
wxIcon libresrc_geticon(const unsigned char *buff, size_t size) { wxIcon libresrc_geticon(const unsigned char *buff, size_t size) {