aboutsummaryrefslogtreecommitdiff
path: root/graphics/macgui
diff options
context:
space:
mode:
authorstevenhoefel2017-02-07 16:26:59 +1100
committerstevenhoefel2017-02-07 16:26:59 +1100
commit7d044c570cd9476b28af6261d69e39bf43ab5a9f (patch)
treeb952563bcc22f47a1166229c23eeb9d7214daa27 /graphics/macgui
parent2d8e52771aaa545119990c819ee4e5ddaad85596 (diff)
downloadscummvm-rg350-7d044c570cd9476b28af6261d69e39bf43ab5a9f.tar.gz
scummvm-rg350-7d044c570cd9476b28af6261d69e39bf43ab5a9f.tar.bz2
scummvm-rg350-7d044c570cd9476b28af6261d69e39bf43ab5a9f.zip
GRAPHICS: Recalculate text area sizing if interLinear is changed.
Diffstat (limited to 'graphics/macgui')
-rw-r--r--graphics/macgui/mactext.cpp7
-rw-r--r--graphics/macgui/mactext.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index e15c8f8da6..180b08175b 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -298,6 +298,11 @@ int MacText::getLineHeight(int line) {
return _textLines[line].height;
}
+void MacText::setInterLinear(int interLinear) {
+ _interLinear = interLinear;
+ recalcDims();
+}
+
void MacText::recalcDims() {
int y = 0;
_textMaxWidth = 0;
@@ -309,7 +314,7 @@ void MacText::recalcDims() {
_textMaxWidth = MAX(_textMaxWidth, getLineWidth(i, true));
}
- _textMaxHeight = y;
+ _textMaxHeight = y - _interLinear;
}
void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff) {
diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index 4df4f1c3aa..85c855950f 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -91,7 +91,7 @@ public:
MacText(Common::String s, MacWindowManager *wm, const Graphics::Font *font, int fgcolor, int bgcolor,
int maxWidth = -1, TextAlign textAlignment = kTextAlignLeft);
- void setInterLinear(int interLinear) { _interLinear = interLinear; }
+ void setInterLinear(int interLinear);
void draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff);
void appendText(Common::String str);