GRAPHICS: MACGUI: Incapsulate MacWindow internals

This commit is contained in:
Eugene Sandulenko 2017-08-03 08:40:20 +02:00
parent 04bb7c3e7a
commit 20734108e3
2 changed files with 4 additions and 4 deletions

View File

@ -77,7 +77,7 @@ void MacTextWindow::resize(int w, int h) {
MacWindow::resize(w, h);
_maxWidth = _innerDims.width();
_maxWidth = getInnerDimensions().width();
_mactext->setMaxWidth(_maxWidth);
}
@ -86,7 +86,7 @@ void MacTextWindow::appendText(Common::String str, const MacFont *macFont, bool
_contentIsDirty = true;
_scrollPos = MAX(0, _mactext->getTextHeight() - _innerDims.height());
_scrollPos = MAX(0, _mactext->getTextHeight() - getInnerDimensions().height());
updateCursorPos();
}
@ -189,7 +189,7 @@ bool MacTextWindow::processEvent(Common::Event &event) {
if (click == kBorderScrollUp || click == kBorderScrollDown) {
if (event.type == Common::EVENT_LBUTTONDOWN) {
int consoleHeight = _innerDims.height();
int consoleHeight = getInnerDimensions().height();
int textFullSize = _mactext->getTextHeight();
float scrollPos = (float)_scrollPos / textFullSize;
float scrollSize = (float)consoleHeight / textFullSize;

View File

@ -308,7 +308,6 @@ protected:
ManagedSurface _composeSurface;
bool _borderIsDirty;
Common::Rect _innerDims;
private:
MacWindowBorder _macBorder;
@ -323,6 +322,7 @@ private:
bool _closeable;
int _borderWidth;
Common::Rect _innerDims;
bool _beingDragged, _beingResized;
int _draggedX, _draggedY;