cleaned Y coordinates

This commit is contained in:
itsmattkc
2019-10-11 18:37:19 +11:00
parent 1ded30c1d9
commit 937acd4c8c
6 changed files with 8 additions and 32 deletions
@@ -40,8 +40,7 @@ TimelineViewGhostItem *TimelineViewGhostItem::FromBlock(Block *block, const Trac
ghost->SetOut(block->out());
ghost->SetMediaIn(block->media_in());
ghost->SetTrack(track);
ghost->SetY(y);
ghost->SetHeight(height);
ghost->SetYCoords(y, height);
ghost->setData(kAttachedBlock, Node::PtrToValue(block));
if (block->type() == Block::kClip) {
+1 -17
View File
@@ -28,25 +28,9 @@ TimelineViewRect::TimelineViewRect(QGraphicsItem* parent) :
}
const int &TimelineViewRect::Y()
{
return y_;
}
void TimelineViewRect::SetY(const int &y)
void TimelineViewRect::SetYCoords(int y, int height)
{
y_ = y;
UpdateRect();
}
const int &TimelineViewRect::Height()
{
return height_;
}
void TimelineViewRect::SetHeight(const int &height)
{
height_ = height;
UpdateRect();
+1 -5
View File
@@ -34,11 +34,7 @@ class TimelineViewRect : public QGraphicsRectItem, public TimelineScaledObject
public:
TimelineViewRect(QGraphicsItem* parent = nullptr);
const int& Y();
void SetY(const int& y);
const int& Height();
void SetHeight(const int& height);
void SetYCoords(int y, int height);
const TrackReference& Track();
void SetTrack(const TrackReference& track);
+1 -2
View File
@@ -172,8 +172,7 @@ void TimelineWidget::ImportTool::DragMove(TimelineViewMouseEvent *event)
ghost->SetTrackAdjustment(track_movement);
TrackReference adjusted_track = ghost->GetAdjustedTrack();
ghost->SetY(parent()->GetTrackY(adjusted_track));
ghost->SetHeight(parent()->GetTrackHeight(adjusted_track));
ghost->SetYCoords(parent()->GetTrackY(adjusted_track), parent()->GetTrackHeight(adjusted_track));
earliest_ghost = qMin(earliest_ghost, ghost->GetAdjustedIn());
}
+3 -4
View File
@@ -249,9 +249,9 @@ void TimelineWidget::PointerTool::ProcessDrag(const TimelineCoordinate &mouse_po
// Track movement is only legal for moving, not for trimming
ghost->SetTrackAdjustment(track_movement);
const TrackReference& track = ghost->GetAdjustedTrack();
ghost->SetY(parent()->GetTrackY(track));
ghost->SetHeight(parent()->GetTrackHeight(track));
ghost->SetYCoords(parent()->GetTrackY(track), parent()->GetTrackHeight(track));
break;
}
}
@@ -341,8 +341,7 @@ TimelineViewGhostItem* TimelineWidget::PointerTool::AddGhostFromNull(const ratio
ghost->SetIn(in);
ghost->SetOut(out);
ghost->SetTrack(track);
ghost->SetY(parent()->GetTrackY(track));
ghost->SetHeight(parent()->GetTrackHeight(track));
ghost->SetYCoords(parent()->GetTrackY(track), parent()->GetTrackHeight(track));
AddGhostInternal(ghost, mode);
+1 -2
View File
@@ -529,8 +529,7 @@ void TimelineWidget::AddBlock(Block *block, TrackReference track)
// Set up clip with view parameters (clip item will automatically size its rect accordingly)
item->SetBlock(block);
item->SetY(GetTrackY(track));
item->SetHeight(GetTrackHeight(track));
item->SetYCoords(GetTrackY(track), GetTrackHeight(track));
item->SetScale(scale_);
item->SetTrack(track);