Piano element handles motion events

This commit is contained in:
Sasha Koshka 2023-03-16 00:25:36 -04:00
parent 5ca9206f65
commit bffdb000ed

View File

@ -88,13 +88,11 @@ func (element *Piano) HandleMouseUp (x, y int, button input.Button) {
element.redo()
}
func (element *Piano) HandleMouseMove (x, y int) {
func (element *Piano) HandleMotion (x, y int) {
if element.pressed == nil { return }
element.pressUnderMouseCursor(image.Pt(x, y))
}
func (element *Piano) HandleMouseScroll (x, y int, deltaX, deltaY float64) { }
func (element *Piano) pressUnderMouseCursor (point image.Point) {
// find out which note is being pressed
newKey := (*pianoKey)(nil)