We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdd86c8 commit 706c9ffCopy full SHA for 706c9ff
src/game/ui/action_menu.rs
@@ -122,9 +122,11 @@ impl ActionMenu {
122
}
123
124
125
- fn update_selection(&mut self, base: &Base, pos: Point) {
126
- let rel = pos - base.rect().top_left();
127
- self.selection = clamp(rel.y / Action::ICON_HEIGHT, 0, self.actions.len() as i32 - 1) as u32;
+ fn update_selection(&mut self, base: &Base, mouse_pos: Point) {
+ let rel_y = mouse_pos.y - base.rect().top;
+ // Apply speed up to mouse movement.
128
+ let rel_y = (rel_y as f64 * 1.5) as i32;
129
+ self.selection = clamp(rel_y / Action::ICON_HEIGHT, 0, self.actions.len() as i32 - 1) as u32;
130
131
132
0 commit comments