summaryrefslogtreecommitdiffstats
path: root/gui/console.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-07-22 19:33:59 +0200
committerEthan Yonker <dees_troy@teamw.in>2015-10-26 17:54:16 +0100
commit44925ad19051d4ffe239b3ba99ea27e7275409dc (patch)
tree5ffc3a491429c71c360553452ea4369aa268e017 /gui/console.cpp
parentAdd nulls during reading of settings and info files (diff)
downloadandroid_bootable_recovery-44925ad19051d4ffe239b3ba99ea27e7275409dc.tar
android_bootable_recovery-44925ad19051d4ffe239b3ba99ea27e7275409dc.tar.gz
android_bootable_recovery-44925ad19051d4ffe239b3ba99ea27e7275409dc.tar.bz2
android_bootable_recovery-44925ad19051d4ffe239b3ba99ea27e7275409dc.tar.lz
android_bootable_recovery-44925ad19051d4ffe239b3ba99ea27e7275409dc.tar.xz
android_bootable_recovery-44925ad19051d4ffe239b3ba99ea27e7275409dc.tar.zst
android_bootable_recovery-44925ad19051d4ffe239b3ba99ea27e7275409dc.zip
Diffstat (limited to '')
-rw-r--r--gui/console.cpp34
1 files changed, 2 insertions, 32 deletions
diff --git a/gui/console.cpp b/gui/console.cpp
index 47caadb15..6b38d6137 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -158,39 +158,9 @@ int GUIConsole::RenderSlideout(void)
return 0;
}
-bool GUIConsole::AddLines()
-{
- if (mLastCount == gConsole.size())
- return false; // nothing to add
-
- size_t prevCount = mLastCount;
- mLastCount = gConsole.size();
-
- // Due to word wrap, figure out what / how the newly added text needs to be added to the render vector that is word wrapped
- // Note, that multiple consoles on different GUI pages may be different widths or use different fonts, so the word wrapping
- // may different in different console windows
- for (size_t i = prevCount; i < mLastCount; i++) {
- string curr_line = gConsole[i];
- string curr_color = gConsoleColor[i];
- for(;;) {
- size_t line_char_width = gr_maxExW(curr_line.c_str(), mFont->GetResource(), mRenderW);
- if (line_char_width < curr_line.size()) {
- rConsole.push_back(curr_line.substr(0, line_char_width));
- rConsoleColor.push_back(curr_color);
- curr_line = curr_line.substr(line_char_width);
- } else {
- rConsole.push_back(curr_line);
- rConsoleColor.push_back(curr_color);
- break;
- }
- }
- }
- return true;
-}
-
int GUIConsole::RenderConsole(void)
{
- AddLines();
+ AddLines(&gConsole, &gConsoleColor, &mLastCount, &rConsole, &rConsoleColor);
GUIScrollList::Render();
// if last line is fully visible, keep tracking the last line when new lines are added
@@ -241,7 +211,7 @@ int GUIConsole::Update(void)
scrollToEnd = true;
}
- if (AddLines()) {
+ if (AddLines(&gConsole, &gConsoleColor, &mLastCount, &rConsole, &rConsoleColor)) {
// someone added new text
// at least the scrollbar must be updated, even if the new lines are currently not visible
mUpdate = 1;