mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Reveal selection when scrolling layer list with up/down arrow keys
Closes #6441.
This commit is contained in:
parent
5e2e1e25e3
commit
0c6c52e8d9
|
@ -3346,7 +3346,9 @@ void CEditor::RenderLayers(CUIRect LayersBox)
|
|||
UnscrolledLayersBox.w = LayersBox.w;
|
||||
}
|
||||
|
||||
const bool ScrollToSelection = SelectLayerByTile();
|
||||
static bool s_ScrollToSelectionNext = false;
|
||||
const bool ScrollToSelection = SelectLayerByTile() || s_ScrollToSelectionNext;
|
||||
s_ScrollToSelectionNext = false;
|
||||
|
||||
// render layers
|
||||
for(int g = 0; g < (int)m_Map.m_vpGroups.size(); g++)
|
||||
|
@ -3772,6 +3774,7 @@ void CEditor::RenderLayers(CUIRect LayersBox)
|
|||
}
|
||||
}
|
||||
}
|
||||
s_ScrollToSelectionNext = true;
|
||||
}
|
||||
if(Input()->KeyPress(KEY_UP) && m_Dialog == DIALOG_NONE && m_EditBoxActive == 0 && s_Operation == OP_NONE)
|
||||
{
|
||||
|
@ -3803,6 +3806,7 @@ void CEditor::RenderLayers(CUIRect LayersBox)
|
|||
}
|
||||
}
|
||||
}
|
||||
s_ScrollToSelectionNext = true;
|
||||
}
|
||||
|
||||
CUIRect AddGroupButton;
|
||||
|
|
Loading…
Reference in a new issue