if (verticalAlign == ITEM_VERTICAL_ALIGN_TOP)
{
- if (itemRect.h > cellRect.h - margin.top)
+ if (itemRect.h > cellRect.h - margin.top - margin.bottom)
{
- itemRect.h = cellRect.h - margin.top;
+ itemRect.h = cellRect.h - margin.top - margin.bottom;
}
itemRect.y = cellRect.y + margin.top;
}
else if (verticalAlign == ITEM_VERTICAL_ALIGN_BOTTOM)
{
- if (itemRect.h > cellRect.h - margin.bottom)
+ if (itemRect.h > cellRect.h - margin.top - margin.bottom)
{
- itemRect.h = cellRect.h - margin.bottom;
+ itemRect.h = cellRect.h - margin.top - margin.bottom;
}
itemRect.y = cellRect.h + cellRect.y - itemRect.h - margin.bottom;
}
}
if (horizonAlign == ITEM_HORIZONTAL_ALIGN_RIGHT)
{
- if (itemRect.w > cellRect.w - margin.right)
+ if (itemRect.w > cellRect.w - margin.right - margin.left)
{
- itemRect.w = cellRect.w - margin.right;
+ itemRect.w = cellRect.w - margin.right - margin.left;
}
itemRect.x = cellRect.w + cellRect.x - itemRect.w - margin.right;
}
else if (horizonAlign == ITEM_HORIZONTAL_ALIGN_LEFT)
{
- if (itemRect.w > cellRect.w - margin.left)
+ if (itemRect.w > cellRect.w - margin.left - margin.right)
{
- itemRect.w = cellRect.w - margin.left;
+ itemRect.w = cellRect.w - margin.left - margin.right;
}
itemRect.x = cellRect.x + margin.left;
}