diff options
author | alberth <alberth@openttd.org> | 2009-07-26 17:29:01 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-07-26 17:29:01 +0000 |
commit | 9856cc9d0a339bace9c50a722e6a2bfc37cbdd88 (patch) | |
tree | abfd00cb0e2915b31761021afe69aa39f372753e /src/window.cpp | |
parent | 2dd998ab06d0f79445bf96239da9944fa30b7578 (diff) | |
download | openttd-9856cc9d0a339bace9c50a722e6a2bfc37cbdd88.tar.xz |
(svn r16963) -Codechange: Added NWidgetViewport widget.
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/window.cpp b/src/window.cpp index 2f79cdc77..4d83af2b3 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -560,9 +560,7 @@ void SetWindowDirty(const Window *w) if (w != NULL) w->SetDirty(); } -/** Re-initialize a window. - * @todo Extend the function to handle viewports. - */ +/** Re-initialize a window. */ void Window::ReInit() { if (this->nested_root == NULL) return; // Only nested widget windows can re-initialize. @@ -595,6 +593,10 @@ void Window::ReInit() if (dx == 0 && dy == 0) { // No resize needed. this->SetDirty(); + if (this->viewport != NULL) { + NWidgetViewport *nvp = (NWidgetViewport *)nested_root->GetWidgetOfType(NWID_VIEWPORT); + nvp->UpdateViewportCoordinates(this); + } return; } @@ -602,7 +604,7 @@ void Window::ReInit() Point diff; diff.x = dx; diff.y = dy; - this->OnResize(diff); + this->OnResize(diff); // Calls NWidgetViewport::UpdateViewportCoordinates() } /** Find the Window whose parent pointer points to this window |