Skip to content

Commit

Permalink
Fix wrong truncation of notification popup messages in ash.
Browse files Browse the repository at this point in the history
views::Label control first calculates the size of the text,
and then tries to render the text in the exact size of rectangle.
If < is used instead of <= in the patched line, the control
flows to the BreakIterator mode, that sometimes computes a
larger width value and causes truncation.

BUG=155663

Review URL: https://codereview.chromium.org/11150013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162308 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
kinaba@chromium.org committed Oct 17, 2012
1 parent 5fc6319 commit 54db05e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/base/text/text_elider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ bool RectangleText::Finalize() {

void RectangleText::AddLine(const string16& line) {
const int line_width = font_.GetStringWidth(line);
if (line_width < available_pixel_width_) {
if (line_width <= available_pixel_width_) {
AddToCurrentLineWithWidth(line, line_width);
} else {
// Iterate over positions that are valid to break the line at. In general,
Expand Down

0 comments on commit 54db05e

Please sign in to comment.