[Scummvm-git-logs] scummvm master -> 7d044c570cd9476b28af6261d69e39bf43ab5a9f
stevenhoefel
stevenhoefel at hotmail.com
Tue Feb 7 06:27:08 CET 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7d044c570c GRAPHICS: Recalculate text area sizing if interLinear is changed.
Commit: 7d044c570cd9476b28af6261d69e39bf43ab5a9f
https://github.com/scummvm/scummvm/commit/7d044c570cd9476b28af6261d69e39bf43ab5a9f
Author: stevenhoefel (stevenhoefel at hotmail.com)
Date: 2017-02-07T16:26:59+11:00
Commit Message:
GRAPHICS: Recalculate text area sizing if interLinear is changed.
Changed paths:
graphics/macgui/mactext.cpp
graphics/macgui/mactext.h
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index e15c8f8..180b081 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 4df4f1c..85c8559 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);
More information about the Scummvm-git-logs
mailing list