mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared] Create a class Dots to share dots masks between CurveView
and RoundCursorView. Use the same dot for illustrations of additional results in Calculation app and Function app
This commit is contained in:
@@ -2,31 +2,17 @@
|
||||
|
||||
namespace Shared {
|
||||
|
||||
static constexpr KDCoordinate cursorSize = 10;
|
||||
static const uint8_t cursorMask[cursorSize][cursorSize] = {
|
||||
{0xFF, 0xFF, 0xFF, 0xED, 0xB6, 0xB6, 0xED, 0xFF, 0xFF, 0xFF},
|
||||
{0xFF, 0xFF, 0x7C, 0x06, 0x00, 0x00, 0x06, 0x7C, 0xFF, 0xFF},
|
||||
{0xFF, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xFF},
|
||||
{0xED, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE5},
|
||||
{0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB6},
|
||||
{0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB6},
|
||||
{0xED, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE5},
|
||||
{0xFF, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xFF},
|
||||
{0xFF, 0xFF, 0x7C, 0x06, 0x00, 0x00, 0x06, 0x7C, 0xFF, 0xFF},
|
||||
{0xFF, 0xFF, 0xFF, 0xED, 0xB6, 0xB6, 0xED, 0xFF, 0xFF, 0xFF},
|
||||
};
|
||||
|
||||
static KDColor s_cursorWorkingBuffer[cursorSize*cursorSize];
|
||||
static KDColor s_cursorWorkingBuffer[Dots::LargeDotDiameter*Dots::LargeDotDiameter];
|
||||
|
||||
void RoundCursorView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
KDRect r = bounds();
|
||||
ctx->getPixels(r, m_underneathPixelBuffer);
|
||||
m_underneathPixelBufferLoaded = true;
|
||||
ctx->blendRectWithMask(r, m_color, (const uint8_t *)cursorMask, s_cursorWorkingBuffer);
|
||||
ctx->blendRectWithMask(r, m_color, (const uint8_t *)Dots::LargeDotMask, s_cursorWorkingBuffer);
|
||||
}
|
||||
|
||||
KDSize RoundCursorView::minimalSizeForOptimalDisplay() const {
|
||||
return KDSize(cursorSize, cursorSize);
|
||||
return KDSize(k_cursorSize, k_cursorSize);
|
||||
}
|
||||
|
||||
void RoundCursorView::setColor(KDColor color) {
|
||||
|
||||
Reference in New Issue
Block a user