Mercurial > hg > svgui
comparison layer/Layer.cpp @ 905:b66fb15de477 cxx11
Working through the float/double and int/sv_frame_t fixes
author | Chris Cannam |
---|---|
date | Mon, 09 Mar 2015 14:35:21 +0000 |
parents | e0f08e108064 |
children | 4a578a360011 |
comparison
equal
deleted
inserted
replaced
904:e0f08e108064 | 905:b66fb15de477 |
---|---|
248 // What if the clipboard point has no reference frame? Then | 248 // What if the clipboard point has no reference frame? Then |
249 // we have to treat it as having its own frame as the | 249 // we have to treat it as having its own frame as the |
250 // reference (i.e. having been copied from the reference | 250 // reference (i.e. having been copied from the reference |
251 // model). | 251 // model). |
252 | 252 |
253 int sourceFrame = i->getFrame(); | 253 sv_frame_t sourceFrame = i->getFrame(); |
254 int referenceFrame = sourceFrame; | 254 sv_frame_t referenceFrame = sourceFrame; |
255 if (i->haveReferenceFrame()) { | 255 if (i->haveReferenceFrame()) { |
256 referenceFrame = i->getReferenceFrame(); | 256 referenceFrame = i->getReferenceFrame(); |
257 } | 257 } |
258 int myMappedFrame = alignToReference(v, sourceFrame); | 258 sv_frame_t myMappedFrame = alignToReference(v, sourceFrame); |
259 | 259 |
260 // cerr << "sourceFrame = " << sourceFrame << ", referenceFrame = " << referenceFrame << " (have = " << i->haveReferenceFrame() << "), myMappedFrame = " << myMappedFrame << endl; | 260 // cerr << "sourceFrame = " << sourceFrame << ", referenceFrame = " << referenceFrame << " (have = " << i->haveReferenceFrame() << "), myMappedFrame = " << myMappedFrame << endl; |
261 | 261 |
262 if (myMappedFrame != referenceFrame) return true; | 262 if (myMappedFrame != referenceFrame) return true; |
263 } | 263 } |
468 } | 468 } |
469 | 469 |
470 void | 470 void |
471 Layer::updateMeasurePixrects(View *v) const | 471 Layer::updateMeasurePixrects(View *v) const |
472 { | 472 { |
473 int sf = v->getStartFrame(); | 473 sv_frame_t sf = v->getStartFrame(); |
474 int ef = v->getEndFrame(); | 474 sv_frame_t ef = v->getEndFrame(); |
475 | 475 |
476 for (MeasureRectSet::const_iterator i = m_measureRects.begin(); | 476 for (MeasureRectSet::const_iterator i = m_measureRects.begin(); |
477 i != m_measureRects.end(); ++i) { | 477 i != m_measureRects.end(); ++i) { |
478 | 478 |
479 // This logic depends on the fact that if one measure rect in | 479 // This logic depends on the fact that if one measure rect in |
507 } | 507 } |
508 | 508 |
509 void | 509 void |
510 Layer::updateMeasureRectYCoords(View *v, const MeasureRect &r) const | 510 Layer::updateMeasureRectYCoords(View *v, const MeasureRect &r) const |
511 { | 511 { |
512 int y0 = lrint(r.startY * v->height()); | 512 int y0 = int(lrint(r.startY * v->height())); |
513 int y1 = lrint(r.endY * v->height()); | 513 int y1 = int(lrint(r.endY * v->height())); |
514 r.pixrect = QRect(r.pixrect.x(), y0, r.pixrect.width(), y1 - y0); | 514 r.pixrect = QRect(r.pixrect.x(), y0, r.pixrect.width(), y1 - y0); |
515 } | 515 } |
516 | 516 |
517 void | 517 void |
518 Layer::setMeasureRectYCoord(View *v, MeasureRect &r, bool start, int y) const | 518 Layer::setMeasureRectYCoord(View *v, MeasureRect &r, bool start, int y) const |