Skip to content

Commit

Permalink
Merge pull request #5401 from Spekular/dropPosition
Browse files Browse the repository at this point in the history
Bias dropped clip position backwards
  • Loading branch information
Spekular authored Apr 12, 2020
2 parents 1746300 + bbb3624 commit 2419433
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1620,9 +1620,13 @@ bool TrackContentWidget::pasteSelection( MidiTime tcoPos, QDropEvent * de )
// TODO -- Need to draw the hovericon either way, or ghost the TCOs
// onto their final position.

float snapSize = gui->songEditor()->m_editor->getSnapSize();
// All patterns should be offset the same amount as the grabbed pattern
MidiTime offset = MidiTime(tcoPos - grabbedTCOPos);
// Users expect clips to "fall" backwards, so bias the offset
offset = offset - MidiTime::ticksPerBar() * snapSize / 2;
// The offset is quantized (rather than the positions) to preserve fine adjustments
int offset = MidiTime(tcoPos - grabbedTCOPos).quantize(gui->songEditor()->m_editor->getSnapSize());
offset = offset.quantize(snapSize);

for( int i = 0; i<tcoNodes.length(); i++ )
{
Expand Down

0 comments on commit 2419433

Please sign in to comment.