diff options
author | glx <glx@openttd.org> | 2010-10-23 17:37:54 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2010-10-23 17:37:54 +0000 |
commit | 3a6892ba10c9f0268ae45d65df7feb13f4d4ea5c (patch) | |
tree | 23ba2d8250d09474a60fa671dd5b8b7e0c350210 | |
parent | cb43ece0914eeaf526828783a24a0c29d2ed96ce (diff) | |
download | openttd-3a6892ba10c9f0268ae45d65df7feb13f4d4ea5c.tar.xz |
(svn r21015) -Fix [FS#4176]: don't let the resize button go past the bottom of the screen
-rw-r--r-- | src/window.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp index 6b03e23d5..1670ca491 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1761,6 +1761,11 @@ static EventState HandleWindowDragging() if (w->resize.step_width == 0) x = 0; if (w->resize.step_height == 0) y = 0; + /* Check the resize button won't go past the bottom of the screen */ + if (w->top + w->height + y > _screen.height) { + y = _screen.height - w->height - w->top; + } + /* X and Y has to go by step.. calculate it. * The cast to int is necessary else x/y are implicitly casted to * unsigned int, which won't work. */ |