25 lines
508 B
C++
25 lines
508 B
C++
#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};
|
|
}
|
|
|
|
//}}
|