summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-09-17 02:52:36 +0200
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-09-17 20:11:34 +0200
commit1f418555a13b63379e4ce52ec96cbed6e04dca7d (patch)
tree6f8166965fd7d560bf2d85ceaeeee1f32005ccf0
parented6a427fcc2da79827fdb63d8a9945fcf2cd643e (diff)
downloadopenttd-1f418555a13b63379e4ce52ec96cbed6e04dca7d.tar.xz
Fix #7742, 66dd7c3: widget position can be negative
-rw-r--r--src/widget.cpp2
-rw-r--r--src/widget_type.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index 71c874a52..f0d53fe6b 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -2494,7 +2494,7 @@ void NWidgetLeaf::Draw(const Window *w)
case WWT_RESIZEBOX:
assert(this->widget_data == 0);
- DrawResizeBox(r, this->colour, this->pos_x < (uint)(w->width / 2), !!(w->flags & WF_SIZING));
+ DrawResizeBox(r, this->colour, this->pos_x < (w->width / 2), !!(w->flags & WF_SIZING));
break;
case WWT_CLOSEBOX:
diff --git a/src/widget_type.h b/src/widget_type.h
index 9d1702488..6372ed799 100644
--- a/src/widget_type.h
+++ b/src/widget_type.h
@@ -174,8 +174,8 @@ public:
uint current_x; ///< Current horizontal size (after resizing).
uint current_y; ///< Current vertical size (after resizing).
- uint pos_x; ///< Horizontal position of top-left corner of the widget in the window.
- uint pos_y; ///< Vertical position of top-left corner of the widget in the window.
+ int pos_x; ///< Horizontal position of top-left corner of the widget in the window.
+ int pos_y; ///< Vertical position of top-left corner of the widget in the window.
NWidgetBase *next; ///< Pointer to next widget in container. Managed by parent container widget.
NWidgetBase *prev; ///< Pointer to previous widget in container. Managed by parent container widget.