mirror of https://github.com/OpenTTD/OpenTTD
(svn r18582) -Codechange: save 8 bytes from the Window class
parent
a4a043344b
commit
c03aadda08
|
@ -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->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->width = this->nested_root->smallest_x;
|
||||||
this->height = this->nested_root->smallest_y;
|
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_width = this->nested_root->resize_x;
|
||||||
this->resize.step_height = this->nested_root->resize_y;
|
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->top = y;
|
||||||
this->width = sm_width;
|
this->width = sm_width;
|
||||||
this->height = sm_height;
|
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_width > 1) x -= x % (int)w->resize.step_width;
|
||||||
if (w->resize.step_height > 1) y -= y % (int)w->resize.step_height;
|
if (w->resize.step_height > 1) y -= y % (int)w->resize.step_height;
|
||||||
|
|
||||||
/* Check if we don't go below the minimum set size */
|
/* Check that we don't go below the minimum set size */
|
||||||
if ((int)w->width + x < (int)w->resize.width) {
|
if ((int)w->width + x < (int)w->nested_root->smallest_x) {
|
||||||
x = w->resize.width - w->width;
|
x = w->nested_root->smallest_x - w->width;
|
||||||
}
|
}
|
||||||
if ((int)w->height + y < (int)w->resize.height) {
|
if ((int)w->height + y < (int)w->nested_root->smallest_y) {
|
||||||
y = w->resize.height - w->height;
|
y = w->nested_root->smallest_y - w->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Window already on size */
|
/* Window already on size */
|
||||||
|
|
|
@ -293,8 +293,6 @@ public:
|
||||||
* Data structure for resizing a window
|
* Data structure for resizing a window
|
||||||
*/
|
*/
|
||||||
struct ResizeInfo {
|
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_width; ///< Step-size of width resize changes
|
||||||
uint step_height; ///< Step-size of height resize changes
|
uint step_height; ///< Step-size of height resize changes
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue