add testblock

This commit is contained in:
stubbfelnewpc
2020-05-06 00:07:20 +02:00
parent 6791244f22
commit 443f999d77
9 changed files with 141 additions and 35 deletions

24
TextBlock.cpp Normal file
View File

@@ -0,0 +1,24 @@
#include "TextBlock.hpp"
#include <string.h>
#include <GUI_Paint.h>
//namespace myink { namespace ui {
TextBlock::TextBlock(const char * t, const TextBlockStyleProperties & s): text(t), style(s)
{
}
TextBlock::~TextBlock()
{
}
PositionalProperties TextBlock::draw(const PositionalProperties & p)
{
auto font = style.font;
Paint_DrawString_EN(p.left, p.top, text, &font, style.background_color, style.font_color);
return { p.left, p.top, strlen(text) * font.Width, font.Height};
}
//}}