ActivityMonitor: allow legend to use full width...

...for the last item when an odd number of items is used in a graph.

Fixes #7262.
This commit is contained in:
Adrien Destugues 2014-12-22 13:44:37 +01:00
parent 459b8e9796
commit 6df2c16cc9

View File

@ -1271,9 +1271,11 @@ ActivityView::_LegendFrameAt(BRect frame, int32 index) const
{
int32 column = index & 1;
int32 row = index / 2;
if (column == 0)
frame.right = frame.left + floorf(frame.Width() / 2) - 5;
else
if (column == 0) {
// The last item, if it is on the first column, can use the full width.
if (index < fSources.CountItems() - 1)
frame.right = frame.left + floorf(frame.Width() / 2) - 5;
} else
frame.left = frame.right - floorf(frame.Width() / 2) + 5;
BAutolock _(fSourcesLock);