feat(display): draw hint animation at touch position instead of center
This commit is contained in:
@@ -108,6 +108,7 @@ HoldState DisplayDriverGFX::updateHold(unsigned long holdMs) {
|
||||
|
||||
if(!_isHolding) {
|
||||
_isHolding = true;
|
||||
state.started = true;
|
||||
}
|
||||
|
||||
state.active = true;
|
||||
@@ -234,7 +235,7 @@ void DisplayDriverGFX::drawDashboard(const ScreenState& state) {
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayDriverGFX::updateHint() {
|
||||
void DisplayDriverGFX::updateHint(int x, int y) {
|
||||
if(!_gfx)
|
||||
return;
|
||||
|
||||
@@ -249,5 +250,6 @@ void DisplayDriverGFX::updateHint() {
|
||||
uint8_t v = static_cast<uint8_t>(30.0f + 30.0f * sinf(t * 2 * 3.14159f));
|
||||
uint16_t col = ((v >> 3) << 11) | ((v >> 2) << 5) | (v >> 3);
|
||||
|
||||
_gfx->drawCircle(DISP_W / 2, DISP_H / 2, 50, col);
|
||||
// Draw at touch position instead of center
|
||||
_gfx->drawCircle(x, y, 50, col);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user