summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2009-12-04 17:03:34 -0500
committerNyx (Neal Orman) <nyx@lindenlab.com>2009-12-04 17:03:34 -0500
commit938c51d2a483962556ee183c24e2b3f635f2c56b (patch)
tree962440abff0e5aa3dfa0fdf34b25f96780bcb3be /indra/llui
parent01f61d4d9e7763cbbf9e21673cb23f71a792e9c4 (diff)
parentfa8b2135f5eaf92b24abe79f908a62e7e2c0a076 (diff)
merge to pull viewer-2 changes into avp
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltextbase.cpp30
-rw-r--r--indra/llui/llview.cpp2
2 files changed, 25 insertions, 7 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index db16670f79..82a3c5cf47 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -543,9 +543,17 @@ void LLTextBase::drawText()
line_end = next_start;
}
+ // A patch for EXT-1944 "Implement ellipses in message well"
+ // introduced a regression where text in SansSerif ending in the
+ // letter "r" is clipped. This may be due to an off-by-one in
+ // font width information out of FreeType with our fractional font
+ // sizes. For now, just make an extra pixel of space to resolve
+ // EXT-2971 "Letter R doesn't show when it's the last letter in a
+ // text block". See James/Richard for details.
+ const S32 FIX_CLIPPING_HACK = 1;
LLRect text_rect(line.mRect.mLeft + mTextRect.mLeft - scrolled_view_rect.mLeft,
line.mRect.mTop - scrolled_view_rect.mBottom + mTextRect.mBottom,
- llmin(mDocumentView->getRect().getWidth(), line.mRect.mRight) - scrolled_view_rect.mLeft,
+ llmin(mDocumentView->getRect().getWidth(), line.mRect.mRight) - scrolled_view_rect.mLeft + FIX_CLIPPING_HACK,
line.mRect.mBottom - scrolled_view_rect.mBottom + mTextRect.mBottom);
// draw a single line of text
@@ -2397,12 +2405,20 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip)
bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const
{
- LLWString text = mEditor.getWText();
-
height = mFontHeight;
- width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars);
- // if last character is a newline, then return true, forcing line break
- llwchar last_char = text[mStart + first_char + num_chars - 1];
+ bool force_newline = false;
+ if (num_chars > 0)
+ {
+ LLWString text = mEditor.getWText();
+ width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars);
+ // if last character is a newline, then return true, forcing line break
+ llwchar last_char = text[mStart + first_char + num_chars - 1];
+ force_newline = (last_char == '\n');
+ }
+ else
+ {
+ width = 0;
+ }
LLUIImagePtr image = mStyle->getImage();
if( image.notNull())
@@ -2411,7 +2427,7 @@ bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt
height = llmax(height, image->getHeight());
}
- return num_chars >= 1 && last_char == '\n';
+ return force_newline;
}
S32 LLNormalTextSegment::getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 23e4131e6d..6f8455774d 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -2533,6 +2533,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent)
else
{
p.rect.left = p.rect.left + parent_rect.getWidth()/2 - p.rect.width/2;
+ p.rect.right.setProvided(false); // recalculate the right
}
}
else
@@ -2553,6 +2554,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent)
else
{
p.rect.bottom = p.rect.bottom + parent_rect.getHeight()/2 - p.rect.height/2;
+ p.rect.top.setProvided(false); // recalculate the top
}
}
else