diff options
author | B. Stack <bgstack15@gmail.com> | 2022-06-26 16:00:37 +0000 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-06-26 16:00:37 +0000 |
commit | 2a026bc7d76875b88700bebc7c5a801fef881bfd (patch) | |
tree | f820b53379f3d14e103e2663e8b0ecd38d1b2105 /wx+/rtl.h | |
parent | Merge branch 'b11.21' into 'master' (diff) | |
parent | add upstream 11.22 (diff) | |
download | FreeFileSync-11.22.tar.gz FreeFileSync-11.22.tar.bz2 FreeFileSync-11.22.zip |
Merge branch '11.22' into 'master'11.22
add upstream 11.22
See merge request opensource-tracking/FreeFileSync!45
Diffstat (limited to 'wx+/rtl.h')
-rw-r--r-- | wx+/rtl.h | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -64,11 +64,15 @@ void drawBitmapRtlMirror(wxDC& dc, const wxImage& img, const wxRect& rect, int a return impl::drawBitmapAligned(dc, img, rect, alignment); case wxLayout_RightToLeft: + if (rect.GetWidth() > 0 && rect.GetHeight() > 0) { - if (!buffer || buffer->GetWidth() != rect.width || buffer->GetHeight() < rect.height) //[!] since we do a mirror, width needs to match exactly! - buffer = wxBitmap(rect.width, rect.height); + if (!buffer || buffer->GetSize() != rect.GetSize()) //[!] since we do a mirror, width needs to match exactly! + buffer.emplace(rect.GetSize()); - wxMemoryDC memDc(*buffer); + if (buffer->GetScaleFactor() != dc.GetContentScaleFactor()) //needed here? + buffer->SetScaleFactor(dc.GetContentScaleFactor()); // + + wxMemoryDC memDc(*buffer); //copies scale factor from wxBitmap memDc.Blit(wxPoint(0, 0), rect.GetSize(), &dc, rect.GetTopLeft()); //blit in: background is mirrored due to memDc, dc having different layout direction! impl::drawBitmapAligned(memDc, img, wxRect(0, 0, rect.width, rect.height), alignment); |