writer over half

This commit is contained in:
stubbfelnewpc
2020-06-09 23:25:35 +02:00
parent 7a7c1a224f
commit 5fe1bd709d
5 changed files with 107 additions and 40 deletions

View File

@@ -7,7 +7,7 @@
//namespace myink { namespace ui {
PositionalProperties Paint_DrawString(UWORD Xstart, UWORD Ystart, const char * pString, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
TextBlock::TextBlock(const char * t, const TextBlockStyleProperties & s): text(t), style(s)
TextBlock::TextBlock(const char * t, const TextBlockStyleProperties & s): style(s), text(t)
{
}
@@ -28,10 +28,11 @@ PositionalProperties Paint_DrawString(UWORD Xstart, UWORD Ystart, const char * p
UWORD max_x_pos = Xstart;
UWORD max_y_pos = Ystart + Font->Height;
UWORD Ypoint = Ystart;
UWORD max_width = 2*Paint.Width;
while (* pString != '\0') {
//if X direction filled , reposition to(Xstart,Ypoint),Ypoint is Y direction plus the Height of the character
if (*pString == '\n'|| (Xpoint + Font->Width ) > Paint.Width ) {
if (*pString == '\n'|| (Xpoint + Font->Width ) > max_width ) {
Xpoint = Xstart;
Ypoint += Font->Height;
if(Ypoint >= max_y_pos) {