summaryrefslogtreecommitdiff
path: root/wx+/image_tools.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <shieldwed@outlook.com>2019-12-14 15:52:53 +0000
committerDaniel Wilhelm <shieldwed@outlook.com>2019-12-14 15:52:53 +0000
commitcc75e50ca861529d50601d247fd66f806fcb23a8 (patch)
treee2c5c7b1f98e64011b1ee8ca4e9bb9157510dfe7 /wx+/image_tools.cpp
parentMerge branch '10.17' into 'master' (diff)
parentadd upstream 10.18 (diff)
downloadFreeFileSync-cc75e50ca861529d50601d247fd66f806fcb23a8.tar.gz
FreeFileSync-cc75e50ca861529d50601d247fd66f806fcb23a8.tar.bz2
FreeFileSync-cc75e50ca861529d50601d247fd66f806fcb23a8.zip
Merge branch '10.18' into 'master'10.18
add upstream 10.18 See merge request opensource-tracking/FreeFileSync!15
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