From d60fd0d022ba66571bb31eea3a0fa422ba97bf26 Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Mon, 20 May 2024 00:18:11 +0200 Subject: [PATCH] Fix glitch with automation points (#7269) Co-authored-by: Dalton Messmer --- src/gui/editors/AutomationEditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index 46521b3f0..9c9e4fd26 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -1647,14 +1647,14 @@ float AutomationEditor::getLevel(int y ) { int level_line_y = height() - SCROLLBAR_SIZE - 1; // pressed level - float level = roundf( ( m_bottomLevel + ( m_y_auto ? + float level = ( ( m_bottomLevel + ( m_y_auto ? ( m_maxLevel - m_minLevel ) * ( level_line_y - y ) / (float)( level_line_y - ( TOP_MARGIN + 2 ) ) : ( level_line_y - y ) / (float)m_y_delta ) ) / m_step ) * m_step; // some range-checking-stuff level = qBound( m_bottomLevel, level, m_topLevel ); - return( level ); + return std::roundf(level); }