remove block enum

Replaced with dynamic casts.
This commit is contained in:
itsmattkc
2021-04-22 11:50:24 +10:00
parent 50644b8e10
commit 269fa6d905
16 changed files with 40 additions and 86 deletions
@@ -45,7 +45,7 @@ void TransitionTool::MousePress(TimelineViewMouseEvent *event)
}
Block* block_at_time = t->BlockAtTime(event->GetFrame());
if (!block_at_time || block_at_time->type() != Block::kClip) {
if (!dynamic_cast<ClipBlock*>(block_at_time)) {
return;
}
@@ -60,8 +60,7 @@ void TransitionTool::MousePress(TimelineViewMouseEvent *event)
trim_mode = Timeline::kTrimIn;
if (cursor_frame < tenth_point
&& block_at_time->previous()
&& block_at_time->previous()->type() == Block::kClip) {
&& dynamic_cast<ClipBlock*>(block_at_time->previous())) {
other_block = block_at_time->previous();
}
} else {
@@ -70,8 +69,7 @@ void TransitionTool::MousePress(TimelineViewMouseEvent *event)
dual_transition_ = (cursor_frame > block_at_time->length() - tenth_point);
if (cursor_frame > block_at_time->length() - tenth_point
&& block_at_time->next()
&& block_at_time->next()->type() == Block::kClip) {
&& dynamic_cast<ClipBlock*>(block_at_time->next())) {
other_block = block_at_time->next();
}
}