reimplemented pointer default functionality

This commit is contained in:
itsmattkc
2019-10-12 06:37:53 +11:00
parent 937acd4c8c
commit 6f4e5a04e4
36 changed files with 146 additions and 63 deletions
@@ -0,0 +1,37 @@
#include "timelineviewenditem.h"
TimelineViewEndItem::TimelineViewEndItem(QGraphicsItem *parent) :
TimelineViewRect(parent),
end_padding_(0)
{
}
void TimelineViewEndItem::SetEndTime(const rational &time)
{
end_time_ = time;
UpdateRect();
}
void TimelineViewEndItem::SetEndPadding(int padding)
{
end_padding_ = padding;
UpdateRect();
}
void TimelineViewEndItem::UpdateRect()
{
// Doesn't need to be more than one pixel
setRect(0, 0, 1, 1);
setPos(TimeToScene(end_time_) + end_padding_, 0);
}
void TimelineViewEndItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
// Item is invisible, this is a no-op
Q_UNUSED(painter)
Q_UNUSED(option)
Q_UNUSED(widget)
}