summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2017-03-26 19:07:08 +0000
committerpeter1138 <peter1138@openttd.org>2017-03-26 19:07:08 +0000
commitefe201d1dfd41abe5b5579a023afc61cd454a1e2 (patch)
tree04c74a1716244a57bd77d69d6ce1ac578b2e3d31
parent31cbcd6de1f1fc50bc16e5ce7949bc63e79054c1 (diff)
downloadopenttd-efe201d1dfd41abe5b5579a023afc61cd454a1e2.tar.xz
(svn r27831) -Fix (r24577): Misaligned resize icon (due to widget bounds being inclusive)
-rw-r--r--src/widget.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index 3aac9611b..0f1743b90 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -507,11 +507,13 @@ static inline void DrawResizeBox(const Rect &r, Colours colour, bool at_left, bo
{
DrawFrameRect(r.left, r.top, r.right, r.bottom, colour, (clicked) ? FR_LOWERED : FR_NONE);
if (at_left) {
+ Dimension d = GetSpriteSize(SPR_WINDOW_RESIZE_LEFT);
DrawSprite(SPR_WINDOW_RESIZE_LEFT, PAL_NONE, r.left + WD_RESIZEBOX_RIGHT + clicked,
- r.bottom - WD_RESIZEBOX_BOTTOM - GetSpriteSize(SPR_WINDOW_RESIZE_LEFT).height + clicked);
+ r.bottom + 1 - WD_RESIZEBOX_BOTTOM - d.height + clicked);
} else {
- DrawSprite(SPR_WINDOW_RESIZE_RIGHT, PAL_NONE, r.left + WD_RESIZEBOX_LEFT + clicked,
- r.bottom - WD_RESIZEBOX_BOTTOM - GetSpriteSize(SPR_WINDOW_RESIZE_RIGHT).height + clicked);
+ Dimension d = GetSpriteSize(SPR_WINDOW_RESIZE_RIGHT);
+ DrawSprite(SPR_WINDOW_RESIZE_RIGHT, PAL_NONE, r.right + 1 - WD_RESIZEBOX_RIGHT - d.width + clicked,
+ r.bottom + 1 - WD_RESIZEBOX_BOTTOM - d.height + clicked);
}
}