Skip to content
Snippets Groups Projects
Commit 713ceb84 authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Added dangling block catch

parent aae90a8f
Branches
No related tags found
No related merge requests found
......@@ -6,14 +6,15 @@
void SlimBlockchainHandler::update(Toolbox& tb) {
bool skip_events = false;
//can't be dragging if mstate changes
if (previous_mstate_ != tb.m_state) {
clear_blocks_();
skip_events = true;
}
//update tracked mstate
previous_mstate_ = tb.m_state;
bool skip_events = false;
/*Handle Messages*/
for (Message& m : tb.mailbox) {
......@@ -31,6 +32,12 @@ void SlimBlockchainHandler::update(Toolbox& tb) {
}
}
//Catch dangling Blocks, if no touches, then no dragging
if (!skip_events && dragpairs_.size() > 0 && tb.current_touchIDs.size() == 0) {
clear_blocks_();
skip_events = true;
}
if (tb.m_state == static_cast<int>(MSTATE::IMMEDIATE) && !skip_events) {
/*Handle Events*/
for (Pevent& pev : tb.events) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment