diff options
Diffstat (limited to 'wx+/image_tools.cpp')
-rw-r--r-- | wx+/image_tools.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wx+/image_tools.cpp b/wx+/image_tools.cpp index b314e801..0f248057 100644 --- a/wx+/image_tools.cpp +++ b/wx+/image_tools.cpp @@ -203,15 +203,15 @@ wxImage zen::createImageFromText(const wxString& text, const wxFont& font, const } -wxBitmap zen::layOver(const wxBitmap& back, const wxBitmap& front, int alignment) +wxImage zen::layOver(const wxImage& back, const wxImage& front, int alignment) { if (!front.IsOk()) return back; + assert(front.HasAlpha() && back.HasAlpha()); const int width = std::max(back.GetWidth(), front.GetWidth()); const int height = std::max(back.GetHeight(), front.GetHeight()); - assert(front.HasAlpha() == back.HasAlpha()); //we don't support mixed-mode brittleness! - const int offsetX = [&] + const int offsetX = [&] { if (alignment & wxALIGN_RIGHT) return back.GetWidth() - front.GetWidth(); @@ -239,8 +239,8 @@ wxBitmap zen::layOver(const wxBitmap& back, const wxBitmap& front, int alignmen ::memset(output.GetAlpha(), wxIMAGE_ALPHA_TRANSPARENT, width * height); const wxPoint posBack(std::max(-offsetX, 0), std::max(-offsetY, 0)); - writeToImage(output, back .ConvertToImage(), posBack); - writeToImage(output, front.ConvertToImage(), posBack + wxPoint(offsetX, offsetY)); + writeToImage(output, back , posBack); + writeToImage(output, front, posBack + wxPoint(offsetX, offsetY)); return output; } |