summaryrefslogtreecommitdiff
path: root/wx+/image_tools.cpp
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2018-10-16 17:33:51 -0400
committerB Stack <bgstack15@gmail.com>2018-10-16 17:33:51 -0400
commit878a41d3be13da2a654df74f2a35ea8b295c8a13 (patch)
tree89b2a018482c164bdd8ecac5c76b19a08f420dec /wx+/image_tools.cpp
parentMerge branch '10.4' into 'master' (diff)
downloadFreeFileSync-878a41d3be13da2a654df74f2a35ea8b295c8a13.tar.gz
FreeFileSync-878a41d3be13da2a654df74f2a35ea8b295c8a13.tar.bz2
FreeFileSync-878a41d3be13da2a654df74f2a35ea8b295c8a13.zip
10.5
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