summaryrefslogtreecommitdiff
path: root/wx+/image_tools.cpp
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2018-10-17 02:11:26 +0000
committerB Stack <bgstack15@gmail.com>2018-10-17 02:11:26 +0000
commitf70f8f961ef8f4d909266f71310e3515f25928e6 (patch)
tree89b2a018482c164bdd8ecac5c76b19a08f420dec /wx+/image_tools.cpp
parentMerge branch '10.4' into 'master' (diff)
parent10.5 (diff)
downloadFreeFileSync-f70f8f961ef8f4d909266f71310e3515f25928e6.tar.gz
FreeFileSync-f70f8f961ef8f4d909266f71310e3515f25928e6.tar.bz2
FreeFileSync-f70f8f961ef8f4d909266f71310e3515f25928e6.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-xwx+/image_tools.cpp16
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;
}
bgstack15