diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-07-03 18:44:25 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-07-03 18:44:25 +0100 |
| commit | eedf7d6c683bca0c850c97d37833a61784eec32d (patch) | |
| tree | f3f0ab87f7c81193e6b77cca5d008b2102b912b1 /src | |
| parent | 12dd7b04ac057e95289306dfe88848b73ded0037 (diff) | |
Fix mouse coordinates in ncurses ui with status on top
Diffstat (limited to 'src')
| -rw-r--r-- | src/ncurses_ui.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 60f62a64..1fc1f0d4 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -482,7 +482,7 @@ Key NCursesUI::get_key() auto wheel_down_mask = NCURSES_MOUSE_MASK(m_wheel_down_button, NCURSES_BUTTON_PRESSED); auto wheel_up_mask = NCURSES_MOUSE_MASK(m_wheel_up_button, NCURSES_BUTTON_PRESSED); - CharCoord pos{ ev.y, ev.x }; + CharCoord pos{ ev.y - (m_status_on_top ? 1 : 0), ev.x }; if ((ev.bstate & BUTTON1_PRESSED) == BUTTON1_PRESSED) return mouse_press(pos); if ((ev.bstate & BUTTON1_RELEASED) == BUTTON1_RELEASED) return mouse_release(pos); if ((ev.bstate & wheel_down_mask) == wheel_down_mask) return mouse_wheel_down(pos); |
