Mercurial > hg > svgui
comparison view/View.cpp @ 359:020c485aa7e0
* More work on aligning copy/paste between layers. It's a surprisingly
complicated business.
author | Chris Cannam |
---|---|
date | Wed, 06 Feb 2008 12:49:49 +0000 |
parents | 9aab6bd27fcc |
children | a9dfa2d6d5ac |
comparison
equal
deleted
inserted
replaced
358:8b69f36c74be | 359:020c485aa7e0 |
---|---|
1118 !m_manager->getPlaybackModel()) { | 1118 !m_manager->getPlaybackModel()) { |
1119 return 0; | 1119 return 0; |
1120 } | 1120 } |
1121 | 1121 |
1122 Model *anyModel = 0; | 1122 Model *anyModel = 0; |
1123 Model *alignedModel = 0; | |
1123 Model *goodModel = 0; | 1124 Model *goodModel = 0; |
1124 | 1125 |
1125 for (LayerList::const_iterator i = m_layers.begin(); | 1126 for (LayerList::const_iterator i = m_layers.begin(); |
1126 i != m_layers.end(); ++i) { | 1127 i != m_layers.end(); ++i) { |
1127 | 1128 |
1131 if (dynamic_cast<TimeRulerLayer *>(layer)) continue; | 1132 if (dynamic_cast<TimeRulerLayer *>(layer)) continue; |
1132 | 1133 |
1133 Model *model = (*i)->getModel(); | 1134 Model *model = (*i)->getModel(); |
1134 if (!model) continue; | 1135 if (!model) continue; |
1135 | 1136 |
1137 anyModel = model; | |
1138 | |
1136 if (model->getAlignmentReference()) { | 1139 if (model->getAlignmentReference()) { |
1137 anyModel = model; | 1140 alignedModel = model; |
1138 if (layer->isLayerOpaque() || | 1141 if (layer->isLayerOpaque() || |
1139 dynamic_cast<RangeSummarisableTimeValueModel *>(model)) { | 1142 dynamic_cast<RangeSummarisableTimeValueModel *>(model)) { |
1140 goodModel = model; | 1143 goodModel = model; |
1141 } | 1144 } |
1142 } | 1145 } |
1143 } | 1146 } |
1144 | 1147 |
1145 if (goodModel) return goodModel; | 1148 if (goodModel) return goodModel; |
1149 else if (alignedModel) return alignedModel; | |
1146 else return anyModel; | 1150 else return anyModel; |
1147 } | 1151 } |
1148 | 1152 |
1149 size_t | 1153 size_t |
1150 View::alignFromReference(size_t f) const | 1154 View::alignFromReference(size_t f) const |