summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-12-20 20:49:47 +0000
committerrubidium <rubidium@openttd.org>2009-12-20 20:49:47 +0000
commitc03aadda08b2a1626aba0a3cd50595df0a368f46 (patch)
tree04058d835237081c967d6e3ed5f3f3ea93869bf5
parenta4a043344b30918f44eb7ccfef1df290e25deafb (diff)
downloadopenttd-c03aadda08b2a1626aba0a3cd50595df0a368f46.tar.xz
(svn r18582) -Codechange: save 8 bytes from the Window class
-rw-r--r--src/window.cpp14
-rw-r--r--src/window_gui.h2
2 files changed, 5 insertions, 11 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 29ddcdff6..2ca6e0104 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -514,8 +514,6 @@ void Window::ReInit(int rx, int ry)
this->nested_root->AssignSizePosition(ST_SMALLEST, 0, 0, this->nested_root->smallest_x, this->nested_root->smallest_y, _dynlang.text_dir == TD_RTL);
this->width = this->nested_root->smallest_x;
this->height = this->nested_root->smallest_y;
- this->resize.width = this->nested_root->smallest_x;
- this->resize.height = this->nested_root->smallest_y;
this->resize.step_width = this->nested_root->resize_x;
this->resize.step_height = this->nested_root->resize_y;
@@ -879,8 +877,6 @@ void Window::InitializePositionSize(int x, int y, int sm_width, int sm_height)
this->top = y;
this->width = sm_width;
this->height = sm_height;
- this->resize.width = sm_width;
- this->resize.height = sm_height;
}
/**
@@ -1611,12 +1607,12 @@ static bool HandleWindowDragging()
if (w->resize.step_width > 1) x -= x % (int)w->resize.step_width;
if (w->resize.step_height > 1) y -= y % (int)w->resize.step_height;
- /* Check if we don't go below the minimum set size */
- if ((int)w->width + x < (int)w->resize.width) {
- x = w->resize.width - w->width;
+ /* Check that we don't go below the minimum set size */
+ if ((int)w->width + x < (int)w->nested_root->smallest_x) {
+ x = w->nested_root->smallest_x - w->width;
}
- if ((int)w->height + y < (int)w->resize.height) {
- y = w->resize.height - w->height;
+ if ((int)w->height + y < (int)w->nested_root->smallest_y) {
+ y = w->nested_root->smallest_y - w->height;
}
/* Window already on size */
diff --git a/src/window_gui.h b/src/window_gui.h
index d2635d881..967340033 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -293,8 +293,6 @@ public:
* Data structure for resizing a window
*/
struct ResizeInfo {
- uint width; ///< Minimum allowed width of the window
- uint height; ///< Minimum allowed height of the window
uint step_width; ///< Step-size of width resize changes
uint step_height; ///< Step-size of height resize changes
};