fix(renderer): Only close a single action
Before the renderer would close all active matching actions. That way nested actions would also close their surrounding action block
This commit is contained in:
parent
4663d01a51
commit
251c3e874a
1 changed files with 5 additions and 0 deletions
|
@ -767,11 +767,16 @@ bool renderer::on(const signals::parser::action_begin& evt) {
|
||||||
|
|
||||||
bool renderer::on(const signals::parser::action_end& evt) {
|
bool renderer::on(const signals::parser::action_end& evt) {
|
||||||
auto btn = evt.cast();
|
auto btn = evt.cast();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Iterate actions in reverse and find the FIRST active action that matches
|
||||||
|
*/
|
||||||
m_log.trace_x("renderer: action_end(btn=%i)", static_cast<int>(btn));
|
m_log.trace_x("renderer: action_end(btn=%i)", static_cast<int>(btn));
|
||||||
for (auto action = m_actions.rbegin(); action != m_actions.rend(); action++) {
|
for (auto action = m_actions.rbegin(); action != m_actions.rend(); action++) {
|
||||||
if (action->active && action->align == m_align && action->button == btn) {
|
if (action->active && action->align == m_align && action->button == btn) {
|
||||||
action->end_x = m_blocks.at(action->align).x;
|
action->end_x = m_blocks.at(action->align).x;
|
||||||
action->active = false;
|
action->active = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue