PianoRoll: fix getKey and remove dead code (#8008)
- Fixes: when right clicking on a piano key close to the lower edge of the screen, "Mark semitone" will mark the wrong key because it uses the upper edge of the context menu as reference. - Fixes: getKey() is off by 2 pixels - Introduces: yCoordOfKey() which is the reverse of getKey() - Removes: section of code that can never be reached --------- Co-authored-by: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com>
This commit is contained in:
@@ -188,7 +188,6 @@ protected:
|
||||
void focusOutEvent( QFocusEvent * ) override;
|
||||
void focusInEvent( QFocusEvent * ) override;
|
||||
|
||||
int getKey( int y ) const;
|
||||
void drawNoteRect( QPainter & p, int x, int y,
|
||||
int width, const Note * n, const QColor & noteCol, const QColor & noteTextColor,
|
||||
const QColor & selCol, const int noteOpc, const bool borderless, bool drawNoteName );
|
||||
@@ -339,6 +338,9 @@ private:
|
||||
int noteEditRight() const;
|
||||
int noteEditLeft() const;
|
||||
|
||||
int getKey(int y) const;
|
||||
int yCoordOfKey(int key) const;
|
||||
|
||||
void dragNotes(int x, int y, bool alt, bool shift, bool ctrl);
|
||||
|
||||
static const int cm_scrollAmtHoriz = 10;
|
||||
|
||||
Reference in New Issue
Block a user