forked from qt-creator/qt-creator
Timeline: Properly account for out-of-bounds events
If an event has to be clipped its length gets shorter ... Change-Id: Ic59abebff3e856214bbb12eca324816b4e9e740d Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
@@ -102,9 +102,12 @@ TimelineRenderPass::State *TimelineSelectionRenderPass::update(
|
||||
top = TimelineModel::defaultRowHeight() * (row + 1) - height;
|
||||
}
|
||||
|
||||
qint64 startTime = model->startTime(selectedItem);
|
||||
qint64 left = qMax(startTime - parentState->start(), (qint64)0);
|
||||
qint64 width = qMin(parentState->end() - startTime, model->duration(selectedItem));
|
||||
qint64 startTime = qBound(parentState->start(), model->startTime(selectedItem),
|
||||
parentState->end());
|
||||
qint64 endTime = qBound(parentState->start(), model->endTime(selectedItem),
|
||||
parentState->end());
|
||||
qint64 left = startTime - parentState->start();
|
||||
qint64 width = endTime - startTime;
|
||||
|
||||
// Construct from upper left and lower right for better precision. When constructing from
|
||||
// left and width the error on the left border is inherited by the right border. Like this
|
||||
|
Reference in New Issue
Block a user