Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Movement direction #357

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/OLEDDisplayUi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,20 @@ void OLEDDisplayUi::drawFrame(){

bool drawnCurrentFrame;


// Probe each frameFunction for the indicator drawn state
FrameState oldFrameState=this->state.frameState;

this->enableIndicator();
this->state.frameState=IN_TRANSITION_OUT;
(this->frameFunctions[this->state.currentFrame])(this->display, &this->state, x, y);
drawnCurrentFrame = this->state.isIndicatorDrawn;

this->enableIndicator();
this->state.frameState=IN_TRANSITION_IN;
(this->frameFunctions[this->getNextFrameNumber()])(this->display, &this->state, x1, y1);

this->state.frameState=oldFrameState;

// Build up the indicatorDrawState
if (drawnCurrentFrame && !this->state.isIndicatorDrawn) {
// Drawn now but not next
Expand Down
2 changes: 2 additions & 0 deletions src/OLEDDisplayUi.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ enum IndicatorDirection {

enum FrameState {
IN_TRANSITION,
IN_TRANSITION_IN,
IN_TRANSITION_OUT,
FIXED
};

Expand Down