|
18 | 18 |
|
19 | 19 | #include <algorithm> |
20 | 20 | #include <functional> |
| 21 | +#include <iterator> |
21 | 22 | #include <limits> |
22 | 23 |
|
23 | 24 | CGUIString::CGUIString(iString start, iString end, bool carriageReturn) |
@@ -161,11 +162,6 @@ void CGUITextLayout::RenderOutline(float x, |
161 | 162 | if (!m_font) |
162 | 163 | return; |
163 | 164 |
|
164 | | - // set the outline color |
165 | | - std::vector<KODI::UTILS::COLOR::Color> outlineColors; |
166 | | - if (!m_colors.empty()) |
167 | | - outlineColors.push_back(outlineColor); |
168 | | - |
169 | 165 | // center our text vertically |
170 | 166 | if (alignment & XBFONT_CENTER_Y) |
171 | 167 | { |
@@ -197,7 +193,7 @@ void CGUITextLayout::RenderOutline(float x, |
197 | 193 |
|
198 | 194 | // don't pass maxWidth through to the renderer for the same reason above: it will cause clipping |
199 | 195 | // on the left. |
200 | | - m_borderFont->DrawText(bx, by, outlineColors, 0, string.m_text, align, 0); |
| 196 | + m_borderFont->DrawText(bx, by, outlineColor, 0, string.m_text, align, 0); |
201 | 197 | by += m_borderFont->GetLineHeight(); |
202 | 198 | } |
203 | 199 | m_borderFont->End(); |
@@ -661,7 +657,7 @@ void CGUITextLayout::WrapText(const vecText &text, float maxWidth) |
661 | 657 | // current line is empty and word is too long: split by character using a safe linear scan. |
662 | 658 | // Do not assume monotonic width because shaping/kerning can make width shrink or grow non-linearly. |
663 | 659 | size_t bestCount = 0; |
664 | | - for (auto it = current; it != wordEnd; ++it) |
| 660 | + for (auto it = std::next(current); it <= wordEnd; ++it) |
665 | 661 | { |
666 | 662 | if (m_font->GetTextWidth({current, it}) <= maxWidth) |
667 | 663 | bestCount = std::distance(current, it); |
|
0 commit comments