2
0
mirror of https://github.com/xvxx/phetch synced 2024-11-10 13:10:54 +00:00

scroll to on select

This commit is contained in:
dvkt 2019-12-21 23:48:52 -08:00
parent ba28a264d7
commit 8137961833

View File

@ -431,14 +431,12 @@ impl Menu {
} }
fn action_select_link(&mut self, link: usize) -> Action { fn action_select_link(&mut self, link: usize) -> Action {
if link < self.links.len() { if let Some(&pos) = self.links.get(link) {
if let Some(&line) = self.links.get(link) { if self.link_visibility(link) != Some(LinkDir::Visible) {
if self.link_visibility(link) != Some(LinkDir::Visible) { if pos > 5 {
if line > SCROLL_LINES { self.scroll = pos - 5;
self.scroll = line - SCROLL_LINES; } else {
} else { self.scroll = 0;
self.scroll = 0;
}
} }
} }
self.link = link; self.link = link;