3D Text: delete selection before pasting

This commit is contained in:
Campbell Barton 2013-12-07 22:57:21 +11:00
parent 6d8f76cfab
commit 0f22eb8564
1 changed files with 3 additions and 0 deletions

View File

@ -780,6 +780,9 @@ static int paste_selection(Object *obedit, ReportList *reports)
/* Verify that the copy buffer => [copy buffer len] + cu->len < MAXTEXT */
if (cu->len + len <= MAXTEXT) {
kill_selection(obedit, 0);
if (len) {
int size = (cu->len * sizeof(wchar_t)) - (cu->pos * sizeof(wchar_t)) + sizeof(wchar_t);
memmove(ef->textbuf + cu->pos + len, ef->textbuf + cu->pos, size);