Text3d: avoid assert, clamp position before getting the selection
This commit is contained in:
parent
ede891808c
commit
9686554633
|
@ -1033,6 +1033,10 @@ static int move_cursor(bContext *C, int type, int select)
|
|||
if (cursmove == -1)
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
if (ef->pos > ef->len) ef->pos = ef->len;
|
||||
else if (ef->pos >= MAXTEXT) ef->pos = MAXTEXT;
|
||||
else if (ef->pos < 0) ef->pos = 0;
|
||||
|
||||
if (select == 0) {
|
||||
if (ef->selstart) {
|
||||
struct Main *bmain = CTX_data_main(C);
|
||||
|
@ -1041,10 +1045,6 @@ static int move_cursor(bContext *C, int type, int select)
|
|||
}
|
||||
}
|
||||
|
||||
if (ef->pos > ef->len) ef->pos = ef->len;
|
||||
else if (ef->pos >= MAXTEXT) ef->pos = MAXTEXT;
|
||||
else if (ef->pos < 0) ef->pos = 0;
|
||||
|
||||
text_update_edited(C, scene, obedit, select, cursmove);
|
||||
|
||||
if (select)
|
||||
|
|
Loading…
Reference in New Issue