提交 7fbdd811 编写于 作者: W wangtiantian

IssueNo:#I3E3J1

Description:Rectify the newline error caused by the newline character in the character string
Sig:graphic
Feature or Bugfix:Bugfix
Binary Source:No
上级 6beac400
......@@ -144,7 +144,8 @@ void TypedText::GetArcLetterPos(const Point& arcCenter, uint16_t radius, float a
uint32_t TypedText::GetNextLine(const char* text, int16_t letterSpace, int16_t maxWidth)
{
uint32_t index = 0;
if ((text == nullptr) || GetWrapPoint(text, index)) {
if ((text == nullptr) || (GetWrapPoint(text, index) &&
(TypedText::GetTextWidth(text, index, letterSpace) <= maxWidth))) {
return index;
}
uint32_t lastBreakPos = 0;
......@@ -183,7 +184,7 @@ uint32_t TypedText::GetNextLine(const char* text, int16_t letterSpace, int16_t m
if (text[index] == '\0') {
break;
}
if (GetWrapPoint(text + index, tmp)) {
if (GetWrapPoint(text + index, tmp) && (TypedText::GetTextWidth(text, index + tmp, letterSpace) <= maxWidth)) {
return index + tmp;
}
index += tmp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册