editor restarts and close actually sleep the screen

This commit is contained in:
aeroreyna
2026-01-08 23:17:17 -05:00
parent 3681a7f81d
commit 564484aa2e
3 changed files with 109 additions and 43 deletions

View File

@@ -557,20 +557,21 @@ parameter:
Color_Foreground : Select the foreground color
Color_Background : Select the background color
******************************************************************************/
void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString,
bool Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString,
sFONT* Font, UWORD Color_Foreground, UWORD Color_Background)
{
UWORD Xpoint = Xstart;
UWORD Ypoint = Ystart;
bool overflow = false;
if (Xstart > Paint.Width || Ystart > Paint.Height) {
Debug("Paint_DrawString_EN Input exceeds the normal display range\r\n");
return;
return overflow;
}
while (* pString != '\0') {
//if X direction filled , reposition to(Xstart,Ypoint),Ypoint is Y direction plus the Height of the character
if ((Xpoint + Font->Width ) > Paint.Width ) {
if ((Xpoint + Font->Width ) > Paint.Width || * pString == '\n') {
Xpoint = Xstart;
Ypoint += Font->Height;
}
@@ -579,8 +580,11 @@ void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString,
if ((Ypoint + Font->Height ) > Paint.Height ) {
Xpoint = Xstart;
Ypoint = Ystart;
overflow = true;
}
if(* pString != '\n'){
Paint_DrawChar(Xpoint, Ypoint, * pString, Font, Color_Background, Color_Foreground);
}
Paint_DrawChar(Xpoint, Ypoint, * pString, Font, Color_Background, Color_Foreground);
//The next character of the address
pString ++;
@@ -588,6 +592,7 @@ void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString,
//The next word of the abscissa increases the font of the broadband
Xpoint += Font->Width;
}
return overflow;
}

View File

@@ -198,7 +198,7 @@ void Paint_DrawCircle(UWORD X_Center, UWORD Y_Center, UWORD Radius, UWORD Color,
//Display string
void Paint_DrawChar(UWORD Xstart, UWORD Ystart, const char Acsii_Char, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
bool Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawString_CN(UWORD Xstart, UWORD Ystart, const char * pString, cFONT* font, UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawNum(UWORD Xpoint, UWORD Ypoint, int32_t Nummber, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawTime(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);