summaryrefslogtreecommitdiff
path: root/wx+/image_tools.cpp
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2019-11-20 08:36:44 -0500
committerB Stack <bgstack15@gmail.com>2019-11-20 08:36:44 -0500
commited50041589974d31296cb30dc1897f7fba6336c2 (patch)
treee2c5c7b1f98e64011b1ee8ca4e9bb9157510dfe7 /wx+/image_tools.cpp
parentMerge branch '10.17' into 'master' (diff)
downloadFreeFileSync-ed50041589974d31296cb30dc1897f7fba6336c2.tar.gz
FreeFileSync-ed50041589974d31296cb30dc1897f7fba6336c2.tar.bz2
FreeFileSync-ed50041589974d31296cb30dc1897f7fba6336c2.zip
add upstream 10.18
Diffstat (limited to 'wx+/image_tools.cpp')
-rw-r--r--wx+/image_tools.cpp10
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;
}
bgstack15