comparison layer/FlexiNoteLayer.cpp @ 799:d6b79166ae0d tonioni

fixed deleteSelectionInclusive to not delete adjacent notes
author matthiasm
date Mon, 16 Jun 2014 11:44:14 +0100
parents 7717751f4407
children 40c6c9344ff6
comparison
equal deleted inserted replaced
798:6eb0b20c940f 799:d6b79166ae0d
1665 m_model->getPoints(s.getStartFrame(), s.getEndFrame()); 1665 m_model->getPoints(s.getStartFrame(), s.getEndFrame());
1666 1666
1667 for (FlexiNoteModel::PointList::iterator i = points.begin(); 1667 for (FlexiNoteModel::PointList::iterator i = points.begin();
1668 i != points.end(); ++i) { 1668 i != points.end(); ++i) {
1669 bool overlap = !( 1669 bool overlap = !(
1670 ((s.getStartFrame() < i->frame) && (s.getEndFrame() < i->frame)) || // selection is left of note 1670 ((s.getStartFrame() <= i->frame) && (s.getEndFrame() <= i->frame)) || // selection is left of note
1671 ((s.getStartFrame() > (i->frame+i->duration-1)) && (s.getEndFrame() > (i->frame+i->duration-1))) // selection is right of note 1671 ((s.getStartFrame() >= (i->frame+i->duration)) && (s.getEndFrame() >= (i->frame+i->duration))) // selection is right of note
1672 ); 1672 );
1673 if (overlap) { 1673 if (overlap) {
1674 command->deletePoint(*i); 1674 command->deletePoint(*i);
1675 } 1675 }
1676 } 1676 }