summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-10-24 14:53:55 +0000
committerrubidium <rubidium@openttd.org>2009-10-24 14:53:55 +0000
commitca0521f89fc53be22e18cb56f6d9c358555246af (patch)
tree709e00edcb606c69ea67ffbf1ba2a115c0bedb70 /src/window.cpp
parentc3992ab7b69461189f217be73136997cd097ee62 (diff)
downloadopenttd-ca0521f89fc53be22e18cb56f6d9c358555246af.tar.xz
(svn r17853) -Codechange: remove the 'delta' parameter from OnResize; it was used in ways that aren't always wanted, causing bugs and the like. Also with nested widgets most reasons for handling OnResize have gone.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 957b5eba3..fc8e605eb 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -640,10 +640,7 @@ void Window::ReInit()
}
ResizeWindow(this, dx, dy); // Sets post-resize dirty blocks.
- Point diff;
- diff.x = dx;
- diff.y = dy;
- this->OnResize(diff); // Calls NWidgetViewport::UpdateViewportCoordinates()
+ this->OnResize(); // Calls NWidgetViewport::UpdateViewportCoordinates()
}
/** Find the Window whose parent pointer points to this window
@@ -1046,11 +1043,7 @@ void Window::FindWindowPlacementAndResize(int def_width, int def_height)
if (this->resize.step_height > 1) enlarge_y -= enlarge_y % (int)this->resize.step_height;
ResizeWindow(this, enlarge_x, enlarge_y);
-
- Point diff;
- diff.x = enlarge_x;
- diff.y = enlarge_y;
- this->OnResize(diff);
+ this->OnResize();
}
int nx = this->left;
@@ -1840,11 +1833,7 @@ static bool HandleWindowDragging()
/* ResizeWindow sets both pre- and after-size to dirty for redrawal */
ResizeWindow(w, x, y);
-
- Point diff;
- diff.x = x;
- diff.y = y;
- w->OnResize(diff);
+ w->OnResize();
return false;
}
}
@@ -2696,11 +2685,7 @@ void RelocateAllWindows(int neww, int newh)
case WC_MAIN_TOOLBAR:
if (neww - w->width != 0) {
ResizeWindow(w, min(neww, 640) - w->width, 0);
-
- Point delta;
- delta.x = neww - w->width;
- delta.y = 0;
- w->OnResize(delta);
+ w->OnResize();
}
top = w->top;