Skip to content

Commit ef6d2dd

Browse files
#3034 fix for Emoji temporarily breaks when chat scrolls up
1 parent 9a6129b commit ef6d2dd

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

indra/llui/lltextbase.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3801,6 +3801,21 @@ LLEmojiTextSegment::LLEmojiTextSegment(const LLUIColor& color, S32 start, S32 en
38013801
{
38023802
}
38033803

3804+
3805+
F32 LLEmojiTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect)
3806+
{
3807+
bool reset_font_buffers = (mLastGeneration != mEditor.getTextGeneration()) && (mLastGeneration != -1);
3808+
3809+
F32 result = LLNormalTextSegment::draw(start, end, selection_start, selection_end, draw_rect);
3810+
3811+
//reset font buffers one more time next iteration, after all other segments are actually drawn
3812+
if (reset_font_buffers)
3813+
{
3814+
mLastGeneration = -1;
3815+
}
3816+
return result;
3817+
}
3818+
38043819
// virtual
38053820
LLTextSegmentPtr LLEmojiTextSegment::clone(LLTextBase& target) const
38063821
{

indra/llui/lltextbase.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ class LLEmojiTextSegment : public LLNormalTextSegment
202202
LLEmojiTextSegment(const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true);
203203
/*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const override;
204204

205+
F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) override;
206+
205207
bool canEdit() const override { return false; }
206208
bool handleToolTip(S32 x, S32 y, MASK mask) override;
207209
};

0 commit comments

Comments
 (0)