diff options
author | Eugene Sandulenko | 2017-08-02 21:08:46 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-08-04 21:54:19 +0200 |
commit | 8609572b879e526d94a3331cebce3322754f81be (patch) | |
tree | 9f9848ea5d248b42e9daa13c3f452a0693b72df9 /graphics | |
parent | b6970ade92a3b92188404b308fa6e839f3063286 (diff) | |
download | scummvm-rg350-8609572b879e526d94a3331cebce3322754f81be.tar.gz scummvm-rg350-8609572b879e526d94a3331cebce3322754f81be.tar.bz2 scummvm-rg350-8609572b879e526d94a3331cebce3322754f81be.zip |
GRAPHICS: MACGUI: Correctly set MacTextWindow internal MacText size
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/macgui/mactext.cpp | 4 | ||||
-rw-r--r-- | graphics/macgui/mactext.h | 1 | ||||
-rw-r--r-- | graphics/macgui/mactextwindow.cpp | 7 | ||||
-rw-r--r-- | graphics/macgui/mactextwindow.h | 2 | ||||
-rw-r--r-- | graphics/macgui/macwindow.h | 2 |
5 files changed, 15 insertions, 1 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 076322636b..20437021cc 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -82,6 +82,10 @@ MacText::MacText(Common::String s, MacWindowManager *wm, const MacFont *macFont, _fullRefresh = true; } +void MacText::setMaxWidth(int maxWidth) { + _maxWidth = maxWidth; +} + void MacText::splitString(Common::String &str) { const char *s = str.c_str(); diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h index 43804ffc41..98bfd64e57 100644 --- a/graphics/macgui/mactext.h +++ b/graphics/macgui/mactext.h @@ -95,6 +95,7 @@ public: int getInterLinear() { return _interLinear; } void setInterLinear(int interLinear); + void setMaxWidth(int maxWidth); void setDefaultFormatting(uint16 fontId_, byte textSlant_, uint16 fontSize_, uint16 palinfo1_, uint16 palinfo2_, uint16 palinfo3_) { _defaultFormatting.setValues(_defaultFormatting.wm, fontId_, textSlant_, fontSize_, palinfo1_, palinfo2_, palinfo3_); diff --git a/graphics/macgui/mactextwindow.cpp b/graphics/macgui/mactextwindow.cpp index 4d4d5a2a31..54c8f77726 100644 --- a/graphics/macgui/mactextwindow.cpp +++ b/graphics/macgui/mactextwindow.cpp @@ -69,6 +69,13 @@ MacTextWindow::MacTextWindow(MacWindowManager *wm, const MacFont *font, int fgco g_system->getTimerManager()->installTimerProc(&cursorTimerHandler, 200000, this, "textWindowCursor"); } +void MacTextWindow::resize(int w, int h) { + _maxWidth = w - kBorderWidth * 2; + _mactext->setMaxWidth(_maxWidth); + + MacWindow::resize(w, h); +} + void MacTextWindow::appendText(Common::String str, const MacFont *macFont) { _mactext->appendText(str, macFont->getId(), macFont->getSize(), macFont->getSlant()); diff --git a/graphics/macgui/mactextwindow.h b/graphics/macgui/mactextwindow.h index fecfeb57be..6cdeea427d 100644 --- a/graphics/macgui/mactextwindow.h +++ b/graphics/macgui/mactextwindow.h @@ -51,6 +51,8 @@ public: MacTextWindow(MacWindowManager *wm, const MacFont *font, int fgcolor, int bgcolor, int maxWidth, TextAlign textAlignment); virtual ~MacTextWindow(); + virtual void resize(int w, int h); + virtual bool processEvent(Common::Event &event); /** diff --git a/graphics/macgui/macwindow.h b/graphics/macgui/macwindow.h index 77be0aee19..2cda99164c 100644 --- a/graphics/macgui/macwindow.h +++ b/graphics/macgui/macwindow.h @@ -198,7 +198,7 @@ public: * @param w New width of the window. * @param h New height of the window. */ - void resize(int w, int h); + virtual void resize(int w, int h); /** * Change the dimensions of the window ([0, 0, 0, 0] by default). |