Files
Upsilon/apps/hardware_test/pattern_view.cpp
Émilie Feral 67e1943679 [apps/hardware_test] Redesign app
Change-Id: If31db838918dd41c13970517bec59e3007b5f402
2017-05-22 16:35:27 +02:00

21 lines
504 B
C++

#include "pattern_view.h"
namespace HardwareTest {
PatternView::PatternView() :
m_pattern(Pattern::patternAtIndex(0))
{
}
void PatternView::setPattern(Pattern p) {
m_pattern = p;
markRectAsDirty(bounds());
}
void PatternView::drawRect(KDContext * ctx, KDRect rect) const {
ctx->fillRect(rect, m_pattern.outlineColor());
ctx->fillRect(KDRect(k_outlineThickness, k_outlineThickness, bounds().width()-2*k_outlineThickness, bounds().height()-2*k_outlineThickness), m_pattern.fillColor());
}
}