Skip to content

Commit eb46e6f

Browse files
authored
Fix Right-click Remove Node Precision with Pitch Bending (#8242)
1 parent ed1e29a commit eb46e6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/gui/editors/PianoRoll.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2832,7 +2832,7 @@ void PianoRoll::updateParameterEditPos(QMouseEvent* me, Note::ParameterType para
28322832
TimePos::ticksPerBar() / m_ppb + m_currentPosition;
28332833

28342834
// Calculate the relative position of the mouse with respect to the note.
2835-
TimePos relativePos = posTicks - m_parameterEditClickedNote->pos();
2835+
TimePos relativePos = Note::quantized(posTicks - m_parameterEditClickedNote->pos(), quantization());
28362836
int relativeKey = keyNum - m_parameterEditClickedNote->key();
28372837

28382838
// Set the quantization of the automation editor to match the piano roll. This is not an ideal system, but it works.
@@ -2848,13 +2848,13 @@ void PianoRoll::updateParameterEditPos(QMouseEvent* me, Note::ParameterType para
28482848
if (m_parameterEditDownLeft)
28492849
{
28502850
// Don't allow the user to drag the first node from the start of the note. They can drag it up and down, but if they try to move it from the first tick, apply the previous drag and start a new one to preserve the node
2851-
if (m_lastParameterEditTick != std::nullopt && Note::quantized(m_lastParameterEditTick.value() - m_parameterEditClickedNote->pos(), quantization()) == 0 && Note::quantized(relativePos, quantization()) != 0)
2851+
if (m_lastParameterEditTick != std::nullopt && Note::quantized(m_lastParameterEditTick.value() - m_parameterEditClickedNote->pos(), quantization()) == 0 && relativePos != 0)
28522852
{
28532853
updateLastEditTick = false;
28542854
aClip->setDragValue(0, relativeKey);
28552855
}
28562856
// Also, don't let the user drag another node onto the first node, since that creates issues with the first node changing height without the user intending it to
2857-
else if (m_lastParameterEditTick != std::nullopt && Note::quantized(m_lastParameterEditTick.value() - m_parameterEditClickedNote->pos(), quantization()) > 0 && Note::quantized(relativePos, quantization()) <= 0)
2857+
else if (m_lastParameterEditTick != std::nullopt && Note::quantized(m_lastParameterEditTick.value() - m_parameterEditClickedNote->pos(), quantization()) > 0 && relativePos <= 0)
28582858
{
28592859
updateLastEditTick = false;
28602860
aClip->setDragValue(quantization(), relativeKey);

0 commit comments

Comments
 (0)