Skip to content

Commit

Permalink
Fixed mouse wheel breaking ? input expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
houmain committed Aug 31, 2024
1 parent 1d6d28b commit e4d4f25
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/runtime/Stage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,8 @@ void Stage::clean_up_history() {
assert(event.state == KeyState::Down);

// do not remove Down without Up
if (!contains(m_history, KeyEvent{ event.key, KeyState::Up }))
const auto up_event = KeyEvent{ event.key, KeyState::Up, event.value };
if (!contains(m_history, up_event))
return;

for (auto context_index : m_active_contexts)
Expand All @@ -892,8 +893,6 @@ void Stage::clean_up_history() {
m_history.erase(m_history.begin());

// also remove Up
assert(event.state == KeyState::Down);
m_history.erase(std::find(m_history.begin(), m_history.end(),
KeyEvent{ event.key, KeyState::Up }));
m_history.erase(std::find(m_history.begin(), m_history.end(), up_event));
}
}

0 comments on commit e4d4f25

Please sign in to comment.