diff options
author | alberth <alberth@openttd.org> | 2010-05-16 19:13:31 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-05-16 19:13:31 +0000 |
commit | b3be440d78f155f6aa0d69cfe7824d65b1394381 (patch) | |
tree | 7264f37f1750ebc75ad7ce8123f3241b7dda0274 /src/widget.cpp | |
parent | a774a286623378fe114a9769f75ee1b142aac8e5 (diff) | |
download | openttd-b3be440d78f155f6aa0d69cfe7824d65b1394381.tar.xz |
(svn r19843) -Codechange: Move ComputeMaxSize() to widget_type.h to make it globally accessible.
Diffstat (limited to 'src/widget.cpp')
-rw-r--r-- | src/widget.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/widget.cpp b/src/widget.cpp index 377ef0667..9a9c3094a 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -942,22 +942,6 @@ void NWidgetContainer::FillNestedArray(NWidgetBase **array, uint length) } /** - * Return the biggest possible size of a nested widget. - * @param base Base size of the widget. - * @param max_space Available space for the widget. - * @param step Stepsize of the widget. - * @return Biggest possible size of the widget, assuming that \a base may only be incremented by \a step size steps. - */ -static inline uint ComputeMaxSize(uint base, uint max_space, uint step) -{ - if (base >= max_space || step == 0) return base; - if (step == 1) return max_space; - int increment = max_space - base; - increment -= increment % step; - return base + increment; -} - -/** * Widgets stacked on top of each other. */ NWidgetStacked::NWidgetStacked() : NWidgetContainer(NWID_SELECTION) |