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