Fix waterfall designer crash and also some linker script fixes (#3281)

* init

* _
This commit is contained in:
未来方舟
2026-08-01 18:57:45 +08:00
committed by GitHub
parent c4f32ac436
commit a4d91f12ef
8 changed files with 864 additions and 238 deletions
+4 -2
View File
@@ -344,7 +344,9 @@ bool MenuView::on_key(const KeyEvent key) {
}
[[fallthrough]];
case KeyEvent::Select:
if (menu_items[highlighted_item].on_select) {
// NB: a MenuView can legitimately be empty (e.g. after clear()) while
// still holding focus; indexing menu_items unchecked faults there.
if (highlighted_item < menu_items.size() && menu_items[highlighted_item].on_select) {
menu_items[highlighted_item].on_select(key);
}
return true;
@@ -364,7 +366,7 @@ bool MenuView::on_keyboard(const KeyboardEvent key) {
if (key == '-') return set_highlighted(highlighted_item - 1);
if (key == '+') return set_highlighted(highlighted_item + 1);
if (key == 10) {
if (menu_items[highlighted_item].on_select) {
if (highlighted_item < menu_items.size() && menu_items[highlighted_item].on_select) {
menu_items[highlighted_item].on_select(KeyEvent::Right);
}
return true;