aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorEugene Sandulenko2017-07-30 08:52:52 +0200
committerEugene Sandulenko2017-08-01 10:42:21 +0200
commit68cd5c8868ade8ebfd331e4fea25d47fe899dc42 (patch)
treeab298fcbf03c1ca015e29bfbbb58e3e4c8af19a4 /graphics
parent6443bee147a1f5a5fd969d1e59695e13e9f79fb6 (diff)
downloadscummvm-rg350-68cd5c8868ade8ebfd331e4fea25d47fe899dc42.tar.gz
scummvm-rg350-68cd5c8868ade8ebfd331e4fea25d47fe899dc42.tar.bz2
scummvm-rg350-68cd5c8868ade8ebfd331e4fea25d47fe899dc42.zip
GRAPHICS: MACGUI: Added method to remove last line from MacText
Diffstat (limited to 'graphics')
-rw-r--r--graphics/macgui/mactext.cpp10
-rw-r--r--graphics/macgui/mactext.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index fa0510b544..2ca60a1745 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -410,4 +410,14 @@ void MacText::replaceLastLine(Common::String str) {
render(oldLen, _textLines.size());
}
+void MacText::removeLastLine() {
+ if (!_textLines.size())
+ return;
+
+ int h = getLineHeight(_textLines.size() - 1) + _interLinear;
+
+ _textLines.pop_back();
+ _textMaxHeight -= h;
+}
+
} // End of namespace Graphics
diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index 3870451014..526d5266dc 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -101,6 +101,7 @@ public:
void appendTextDefault(Common::String str);
void clearText();
void replaceLastLine(Common::String str);
+ void removeLastLine();
int getLineCount() { return _textLines.size(); }
void render();