Mercurial > hg > svgui
comparison layer/FlexiNoteLayer.cpp @ 715:7169d08e9467 tonioni
Snapping to feature frame rightwards in flexi-note should snap to the end of a note as well as the start (should also snap to start of next one, but that doesn't seem to work either -- not enough points returned by getPoints). This should possibly happen in plain note and region layers too.
| author | Chris Cannam |
|---|---|
| date | Fri, 10 Jan 2014 14:17:10 +0000 |
| parents | 797eb48f38c1 |
| children | 137d3ff48f73 |
comparison
equal
deleted
inserted
replaced
| 714:797eb48f38c1 | 715:7169d08e9467 |
|---|---|
| 611 bool found = false; | 611 bool found = false; |
| 612 | 612 |
| 613 for (FlexiNoteModel::PointList::const_iterator i = points.begin(); | 613 for (FlexiNoteModel::PointList::const_iterator i = points.begin(); |
| 614 i != points.end(); ++i) { | 614 i != points.end(); ++i) { |
| 615 | 615 |
| 616 cerr << "FlexiNoteModel: point at " << i->frame << endl; | |
| 617 | |
| 616 if (snap == SnapRight) { | 618 if (snap == SnapRight) { |
| 617 | 619 |
| 618 if (i->frame > frame) { | 620 if (i->frame > frame) { |
| 619 snapped = i->frame; | 621 snapped = i->frame; |
| 622 found = true; | |
| 623 break; | |
| 624 } else if (i->frame + i->duration >= frame) { | |
| 625 snapped = i->frame + i->duration; | |
| 620 found = true; | 626 found = true; |
| 621 break; | 627 break; |
| 622 } | 628 } |
| 623 | 629 |
| 624 } else if (snap == SnapLeft) { | 630 } else if (snap == SnapLeft) { |
| 651 found = true; | 657 found = true; |
| 652 break; | 658 break; |
| 653 } | 659 } |
| 654 } | 660 } |
| 655 } | 661 } |
| 662 | |
| 663 cerr << "snapToFeatureFrame: frame " << frame << " -> snapped " << snapped << ", found = " << found << endl; | |
| 656 | 664 |
| 657 frame = snapped; | 665 frame = snapped; |
| 658 return found; | 666 return found; |
| 659 } | 667 } |
| 660 | 668 |
