From 0c0962189575f463f29ed70718c30bfd1d41c0c3 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 30 Oct 2015 10:35:43 +0100 Subject: [PATCH] Fix calculation of message height area in a toast panel --- indra/llui/lltextbase.h | 3 +++ indra/newview/lltoastpanel.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 32f500ccbd..4c1ee6534e 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -504,6 +504,9 @@ public: void setWordWrap(bool wrap); LLScrollContainer* getScrollContainer() const { return mScroller; } + // Getter for line spacing (pixels) + S32 getLineSpacingPixels() const { return mLineSpacingPixels; } + protected: // protected member variables // List of offsets and segment index of the start of each line. Always has at least one node (0). diff --git a/indra/newview/lltoastpanel.cpp b/indra/newview/lltoastpanel.cpp index 8994d4cab9..d832a7cff5 100755 --- a/indra/newview/lltoastpanel.cpp +++ b/indra/newview/lltoastpanel.cpp @@ -70,7 +70,10 @@ const LLUUID& LLToastPanel::getID() S32 LLToastPanel::computeSnappedToMessageHeight(LLTextBase* message, S32 maxLineCount) { S32 heightDelta = 0; - S32 maxTextHeight = message->getFont()->getLineHeight() * maxLineCount; + // Don't forget about line spacing! + //S32 maxTextHeight = message->getFont()->getLineHeight() * maxLineCount; + S32 maxTextHeight = (message->getFont()->getLineHeight() + message->getLineSpacingPixels()) * maxLineCount; + // LLRect messageRect = message->getRect(); S32 oldTextHeight = messageRect.getHeight();