We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
存在问题的函数:
LCUI/src/font/textlayer.c
Lines 962 to 967 in ea409f1
/* 如果当前行为空,也不是第一行,并且上一行没有结束符 */ if (len <= 0 && end_y > 0 && prev_txtrow->eol != LCUI_EOL_NONE) { TextRowList_RemoveRow(&layer->text_rows, end_y); return 0; <<这里添加return可以解决bug } /* 调整起始行的容量 */ TextRow_SetLength(txtrow, len); <<< 这里异常,因为txtrow已经被释放掉了(TextRowList_RemoveRow)
i = char_x; j = end_x; <<< 原始代码这里为end_x + 1,这里不应该+1 end_y = char_y + 1; /* 将结束行的内容拼接至起始行 */ for (; i < len && j < end_txtrow->length; ++i, ++j) { txtrow->string[i] = end_txtrow->string[j]; <<< **这里吧下一行的字符数据与当前行进行拼接** } TextLayer_UpdateRowSize(layer, txtrow); TextLayer_InvalidateRowRect(layer, end_y, 0, -1); /* 移除结束行 */ TextRowList_RemoveRow(&layer->text_rows, end_y); <<< **这里释放掉原来行的LCUI_TextRow,形成空指针。** /* 如果起始行无内容,并且上一行没有结束符(换行符),则 * 说明需要删除起始行 */ if (len <= 0 && char_y > 0 && prev_txtrow->eol != LCUI_EOL_NONE) { TextLayer_InvalidateRowRect(layer, char_y, 0, -1); TextRowList_RemoveRow(&layer->text_rows, char_y); } TextLayer_AddUpdateTypeset(layer, char_y);
The text was updated successfully, but these errors were encountered:
lc-soft
No branches or pull requests
存在问题的函数:
LCUI/src/font/textlayer.c
Lines 962 to 967 in ea409f1
The text was updated successfully, but these errors were encountered: