BMenuItem: Round to prevent unneeded truncation

The case I fear is if frameWidth is 99.999999 and labelWidth is 100.0
it will attempt to perform a truncation unnecessarily.
This commit is contained in:
John Scipione
2013-05-08 14:26:44 -04:00
parent a130bab351
commit a61d468cf9
+1 -1
View File
@@ -408,7 +408,7 @@ BMenuItem::DrawContent()
const BRect& padding = menuPrivate.Padding();
float frameWidth = fSuper->Frame().Width() - padding.left - padding.right;
if (frameWidth >= labelWidth)
if (roundf(frameWidth) >= roundf(labelWidth))
fSuper->DrawString(fLabel);
else {
// truncate label to fit