Files
Upsilon/escher/src/buffer_text_view.cpp
Émilie Feral 73213435f0 [escher] Initiate the buffer to "" in buffer text view
Change-Id: Ib197d9a70261811d7dcb778cf91d17b4670ea5e9
2017-05-05 10:19:05 +02:00

21 lines
575 B
C++

#include <escher/buffer_text_view.h>
#include <string.h>
#include <assert.h>
BufferTextView::BufferTextView(KDText::FontSize size, float horizontalAlignment, float verticalAlignment,
KDColor textColor, KDColor backgroundColor) :
TextView(size, horizontalAlignment, verticalAlignment, textColor, backgroundColor),
m_buffer("")
{
}
const char * BufferTextView::text() const {
return m_buffer;
}
void BufferTextView::setText(const char * text) {
assert(strlen(text) < sizeof(m_buffer));
strlcpy(m_buffer, text, sizeof(m_buffer));
markRectAsDirty(bounds());
}