(svn r27821) -Change: Draw images in centre of buttons (inspired by Juanjo)

This commit is contained in:
2017-03-23 22:00:00 +00:00
parent 902663176d
commit bcc5c9f81d
2 changed files with 21 additions and 10 deletions

View File

@@ -142,6 +142,18 @@ void CheckBlitter();
bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int height);
/**
* Determine where to draw a centred object inside a widget.
* @param min The top or left coordinate.
* @param max The bottom or right coordinate.
* @param size The height or width of the object to draw.
* @return Offset of where to start drawing the object.
*/
static inline int CenterBounds(int min, int max, uint size)
{
return min + (max - min - size + 1) / 2;
}
/* window.cpp */
void DrawOverlappedWindowForAll(int left, int top, int right, int bottom);