From 0d3bd614c779194cb1394de2c84156538328273b Mon Sep 17 00:00:00 2001 From: Siarzhuk Zharski Date: Sun, 16 Dec 2012 17:55:46 +0100 Subject: [PATCH] Do not include CR-terminator in line width-height calculations Fixes #3658 --- src/kits/interface/TextView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp index 9a027c953b..aa2300f601 100644 --- a/src/kits/interface/TextView.cpp +++ b/src/kits/interface/TextView.cpp @@ -4063,7 +4063,9 @@ BTextView::_FindLineBreak(int32 fromOffset, float *outAscent, float *outDescent, delta = max_c(delta, 1); - deltaWidth = _TabExpandedStyledWidth(offset, delta, &ascent, &descent); + // do not include B_ENTER-terminator into width & height calculations + deltaWidth = _TabExpandedStyledWidth(offset, + done ? delta - 1 : delta, &ascent, &descent); strWidth += deltaWidth; if (strWidth >= *inOutWidth) {