summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-10-13 13:49:45 +0000
committerfrosch <frosch@openttd.org>2013-10-13 13:49:45 +0000
commitca18a4abefbe2c8edcc23b46244787c0cf74a580 (patch)
tree3b95a2e1a8f669b3f3727c6f2dad460e129fb3c8
parent27a77d2c0991a1bff10a225e00e2227172bb1ee3 (diff)
downloadopenttd-ca18a4abefbe2c8edcc23b46244787c0cf74a580.tar.xz
(svn r25862) -Fix [FS#5715] (r25729): Usage of implicit unsigned wrap around. (sbr)
-rw-r--r--src/widget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index 71448f612..6edcd1d74 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -1251,12 +1251,12 @@ void NWidgetHorizontal::AssignSizePosition(SizingType sizing, uint x, uint y, ui
NWidgetBase *child_wid = this->head;
while (child_wid != NULL) {
uint child_width = child_wid->current_x;
- uint child_x = x + position + (rtl ? -child_width - child_wid->padding_left : child_wid->padding_left);
+ uint child_x = x + (rtl ? position - child_width - child_wid->padding_left : position + child_wid->padding_left);
uint child_y = y + child_wid->padding_top;
child_wid->AssignSizePosition(sizing, child_x, child_y, child_width, child_wid->current_y, rtl);
uint padded_child_width = child_width + child_wid->padding_right + child_wid->padding_left;
- position += rtl ? -padded_child_width : padded_child_width;
+ position = rtl ? position - padded_child_width : position + padded_child_width;
child_wid = child_wid->next;
}