From a61d468cf92c71160a57130ca96522d24cab962c Mon Sep 17 00:00:00 2001 From: John Scipione Date: Wed, 8 May 2013 13:51:32 -0400 Subject: [PATCH] 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. --- src/kits/interface/MenuItem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/interface/MenuItem.cpp b/src/kits/interface/MenuItem.cpp index c27645e336..4e5691b2ab 100644 --- a/src/kits/interface/MenuItem.cpp +++ b/src/kits/interface/MenuItem.cpp @@ -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