From 68cd5c8868ade8ebfd331e4fea25d47fe899dc42 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 30 Jul 2017 08:52:52 +0200 Subject: GRAPHICS: MACGUI: Added method to remove last line from MacText --- graphics/macgui/mactext.cpp | 10 ++++++++++ graphics/macgui/mactext.h | 1 + 2 files changed, 11 insertions(+) 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(); -- cgit v1.2.3