diff options
author | B Stack <bgstack15@gmail.com> | 2018-10-17 02:11:26 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2018-10-17 02:11:26 +0000 |
commit | f70f8f961ef8f4d909266f71310e3515f25928e6 (patch) | |
tree | 89b2a018482c164bdd8ecac5c76b19a08f420dec /wx+/image_tools.cpp | |
parent | Merge branch '10.4' into 'master' (diff) | |
parent | 10.5 (diff) | |
download | FreeFileSync-10.5.tar.gz FreeFileSync-10.5.tar.bz2 FreeFileSync-10.5.zip |
Merge branch '10.5' into 'master'10.5
10.5
See merge request opensource-tracking/FreeFileSync!2
Diffstat (limited to 'wx+/image_tools.cpp')
-rwxr-xr-x | wx+/image_tools.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/wx+/image_tools.cpp b/wx+/image_tools.cpp index 4748a590..b314e801 100755 --- a/wx+/image_tools.cpp +++ b/wx+/image_tools.cpp @@ -141,10 +141,10 @@ wxImage zen::createImageFromText(const wxString& text, const wxFont& font, const int maxWidth = 0; int lineHeight = 0; - for (const auto& li : lineInfo) + for (const auto& [lineText, lineSize] : lineInfo) { - maxWidth = std::max(maxWidth, li.second.GetWidth()); - lineHeight = std::max(lineHeight, li.second.GetHeight()); //wxWidgets comment "GetTextExtent will return 0 for empty string" + maxWidth = std::max(maxWidth, lineSize.GetWidth()); + lineHeight = std::max(lineHeight, lineSize.GetHeight()); //wxWidgets comment "GetTextExtent will return 0 for empty string" } if (maxWidth == 0 || lineHeight == 0) return wxImage(); @@ -160,19 +160,19 @@ wxImage zen::createImageFromText(const wxString& text, const wxFont& font, const dc.SetFont(font); int posY = 0; - for (const auto& li : lineInfo) + for (const auto& [lineText, lineSize] : lineInfo) { - if (!li.first.empty()) + if (!lineText.empty()) switch (textAlign) { case ImageStackAlignment::LEFT: - dc.DrawText(li.first, wxPoint(0, posY)); + dc.DrawText(lineText, wxPoint(0, posY)); break; case ImageStackAlignment::RIGHT: - dc.DrawText(li.first, wxPoint(maxWidth - li.second.GetWidth(), posY)); + dc.DrawText(lineText, wxPoint(maxWidth - lineSize.GetWidth(), posY)); break; case ImageStackAlignment::CENTER: - dc.DrawText(li.first, wxPoint((maxWidth - li.second.GetWidth()) / 2, posY)); + dc.DrawText(lineText, wxPoint((maxWidth - lineSize.GetWidth()) / 2, posY)); break; } |