(svn r19843) -Codechange: Move ComputeMaxSize() to widget_type.h to make it globally accessible.

This commit is contained in:
alberth
2010-05-16 19:13:31 +00:00
parent a774a28662
commit b3be440d78
2 changed files with 16 additions and 16 deletions

View File

@@ -941,22 +941,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.
*/