mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 13:17:34 +00:00
Piano: Fix insertion and deletion of notes
On mouse move the pressed button is not present in the event argument which causes the corresponding code to never fire. Instead it now stores the original mouse down event and acts according to that on mouse move.
This commit is contained in:
parent
4ab7216827
commit
815442b2b5
6 changed files with 71 additions and 46 deletions
|
@ -43,12 +43,13 @@ private:
|
|||
double m_note_width { 0.0 };
|
||||
int m_zoom_level { 1 };
|
||||
|
||||
Optional<Gfx::IntPoint> m_note_drag_start;
|
||||
Optional<RollNote> m_note_drag_location;
|
||||
int m_drag_note;
|
||||
Optional<GUI::MouseEvent> m_mousedown_event;
|
||||
|
||||
RefPtr<Gfx::Bitmap> m_background;
|
||||
int m_prev_zoom_level { m_zoom_level };
|
||||
int m_prev_scroll_x { horizontal_scrollbar().value() };
|
||||
int m_prev_scroll_y { vertical_scrollbar().value() };
|
||||
|
||||
u8 get_pitch_for_y(int y) const;
|
||||
int get_note_for_x(int x) const;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue