summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/displayapp/DisplayApp.cpp2
-rw-r--r--src/displayapp/screens/InfiniPaint.cpp11
-rw-r--r--src/displayapp/screens/InfiniPaint.h6
3 files changed, 12 insertions, 7 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp
index 04aec4c4..a90a1e5d 100644
--- a/src/displayapp/DisplayApp.cpp
+++ b/src/displayapp/DisplayApp.cpp
@@ -410,7 +410,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
currentScreen = std::make_unique<Screens::Twos>(this);
break;
case Apps::Paint:
- currentScreen = std::make_unique<Screens::InfiniPaint>(this, lvgl,motorController);
+ currentScreen = std::make_unique<Screens::InfiniPaint>(this, lvgl, motorController);
break;
case Apps::Paddle:
currentScreen = std::make_unique<Screens::Paddle>(this, lvgl);
diff --git a/src/displayapp/screens/InfiniPaint.cpp b/src/displayapp/screens/InfiniPaint.cpp
index 66391b12..c5ff27b4 100644
--- a/src/displayapp/screens/InfiniPaint.cpp
+++ b/src/displayapp/screens/InfiniPaint.cpp
@@ -4,7 +4,10 @@
using namespace Pinetime::Applications::Screens;
-InfiniPaint::InfiniPaint(Pinetime::Applications::DisplayApp* app, Pinetime::Components::LittleVgl& lvgl, Pinetime::Controllers::MotorController& motor) : Screen(app), lvgl {lvgl}, motor{motor} {
+InfiniPaint::InfiniPaint(Pinetime::Applications::DisplayApp* app,
+ Pinetime::Components::LittleVgl& lvgl,
+ Pinetime::Controllers::MotorController& motor)
+ : Screen(app), lvgl {lvgl}, motor {motor} {
std::fill(b, b + bufferSize, selectColor);
}
@@ -15,7 +18,11 @@ InfiniPaint::~InfiniPaint() {
bool InfiniPaint::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
switch (event) {
case Pinetime::Applications::TouchEvents::LongTap:
+ color = (color + 1) % 8;
switch (color) {
+ case 0:
+ selectColor = LV_COLOR_MAGENTA;
+ break;
case 1:
selectColor = LV_COLOR_GREEN;
break;
@@ -40,12 +47,10 @@ bool InfiniPaint::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
default:
color = 0;
- selectColor = LV_COLOR_MAGENTA;
break;
}
std::fill(b, b + bufferSize, selectColor);
- color++;
motor.RunForDuration(50);
return true;
default:
diff --git a/src/displayapp/screens/InfiniPaint.h b/src/displayapp/screens/InfiniPaint.h
index 8a96fc6d..fb0bd9be 100644
--- a/src/displayapp/screens/InfiniPaint.h
+++ b/src/displayapp/screens/InfiniPaint.h
@@ -1,9 +1,9 @@
#pragma once
-#include <lvgl/lvgl.h>
-#include <cstdint>
#include "Screen.h"
#include "components/motor/MotorController.h"
+#include <cstdint>
+#include <lvgl/lvgl.h>
namespace Pinetime {
namespace Components {
@@ -30,7 +30,7 @@ namespace Pinetime {
static constexpr uint16_t bufferSize = width * height;
lv_color_t b[bufferSize];
lv_color_t selectColor = LV_COLOR_WHITE;
- uint8_t color = 3;
+ uint8_t color = 2;
};
}
}