comparison layer/TimeInstantLayer.cpp @ 1461:e561f0a8d75b

Fix incorrect repaint at left edge in segmentation mode
author Chris Cannam
date Mon, 20 May 2019 15:04:07 +0100
parents 9abddbd57667
children 696e569ff21b
comparison
equal deleted inserted replaced
1460:69b7fdd6394f 1461:e561f0a8d75b
302 int x0 = rect.left(), x1 = rect.right(); 302 int x0 = rect.left(), x1 = rect.right();
303 303
304 sv_frame_t frame0 = v->getFrameForX(x0); 304 sv_frame_t frame0 = v->getFrameForX(x0);
305 sv_frame_t frame1 = v->getFrameForX(x1); 305 sv_frame_t frame1 = v->getFrameForX(x1);
306 306
307 EventVector points(m_model->getEventsWithin(frame0, frame1 - frame0)); 307 int overspill = 0;
308 if (m_plotStyle == PlotSegmentation) {
309 // We need to start painting at the prior point, so we can
310 // fill in the visible part of its segmentation area
311 overspill = 1;
312 }
313
314 EventVector points(m_model->getEventsWithin(frame0, frame1 - frame0,
315 overspill));
308 316
309 bool odd = false; 317 bool odd = false;
310 if (m_plotStyle == PlotSegmentation && !points.empty()) { 318 if (m_plotStyle == PlotSegmentation && !points.empty()) {
311 int index = m_model->getRowForFrame(points.begin()->getFrame()); 319 int index = m_model->getRowForFrame(points.begin()->getFrame());
312 odd = ((index % 2) == 1); 320 odd = ((index % 2) == 1);