From 137f00b657bd072c83b2960567afca20adc6cfeb Mon Sep 17 00:00:00 2001 From: elasota Date: Fri, 3 Jul 2020 03:05:25 -0400 Subject: [PATCH] Fixed selection drawing out of bounds in multi-line editbox --- PortabilityLayer/PLEditboxWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PortabilityLayer/PLEditboxWidget.cpp b/PortabilityLayer/PLEditboxWidget.cpp index d304878..46a607d 100644 --- a/PortabilityLayer/PLEditboxWidget.cpp +++ b/PortabilityLayer/PLEditboxWidget.cpp @@ -780,7 +780,7 @@ namespace PortabilityLayer const Rect midLinesRect = Rect::Create(globalSelStart.m_y + lineGap, m_rect.left, globalSelEnd.m_y, m_rect.right).Intersect(m_rect); surface->FillRect(midLinesRect, focusColor); - Rect lastLineRect = Rect::Create(globalSelEnd.m_y, m_rect.left, globalSelEnd.m_y + lineGap, globalSelEnd.m_x); + Rect lastLineRect = Rect::Create(globalSelEnd.m_y, m_rect.left, globalSelEnd.m_y + lineGap, globalSelEnd.m_x).Intersect(m_rect); if (endIsLineBreak || (m_isMultiLine == false && m_selEndChar == m_length)) lastLineRect.right = m_rect.right;