Fix index out-of-range in pos_to_index
Fix a crash occurring from trying to access a list with a negative index when drag-selecting text above the field box boundaries.(cherry picked from commit 609538b441a0dcf7890b4656c98673ee8de8820d)
This commit is contained in:
parent
b0b8813022
commit
3b55244296
@ -893,6 +893,9 @@ class TextEditorWrapped(Widget):
|
||||
|
||||
if line >= len(textL):
|
||||
line = len(textL) - 1
|
||||
|
||||
if line < 0:
|
||||
line = 0
|
||||
|
||||
def width(i):
|
||||
return font.size(textL[line][:i])[0]
|
||||
|
Reference in New Issue
Block a user