Skip to content
Snippets Groups Projects
Commit 347585cf authored by Monroe Linden's avatar Monroe Linden
Browse files

Fix for EXT-6276.

Added a check in LLTextBase::drawSelectionBackground() to keep it from sending degenerate rectangles to gl_rect_2d().  This seems to be what was causing the GL state to go bad.

Reviewed by Richard at http://codereview.lindenlab.com/534001
parent aa65ce52
Branches
Tags
No related merge requests found
...@@ -396,11 +396,16 @@ void LLTextBase::drawSelectionBackground() ...@@ -396,11 +396,16 @@ void LLTextBase::drawSelectionBackground()
++rect_it) ++rect_it)
{ {
LLRect selection_rect = *rect_it; LLRect selection_rect = *rect_it;
// Don't send empty rects to gl_rect_2d.
// Drawing degenerate rectangles seems to cause https://jira.secondlife.com/browse/EXT-6276 .
if(selection_rect.notEmpty())
{
selection_rect.translate(mVisibleTextRect.mLeft - content_display_rect.mLeft, mVisibleTextRect.mBottom - content_display_rect.mBottom); selection_rect.translate(mVisibleTextRect.mLeft - content_display_rect.mLeft, mVisibleTextRect.mBottom - content_display_rect.mBottom);
gl_rect_2d(selection_rect, selection_color); gl_rect_2d(selection_rect, selection_color);
} }
} }
} }
}
void LLTextBase::drawCursor() void LLTextBase::drawCursor()
{ {
......
...@@ -202,6 +202,11 @@ void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, S32 pixe ...@@ -202,6 +202,11 @@ void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, S32 pixe
void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled )
{ {
// FIXME: Drawing degenerate rectangles (specifically, zero-width rectangles) was causing
// https://jira.secondlife.com/browse/EXT-6276 on the Mac (presumably it was doing something bad to the GL state).
// That was fixed by checking for this case in LLTextBase::drawSelectionBackground().
// It's possible we should check for degenerate rectangles here and not draw, but I wanted to do the minimal change for the moment.
stop_glerror(); stop_glerror();
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment