fixed splitting bug
This commit is contained in:
@@ -33,13 +33,10 @@ Block *ClipBlock::copy()
|
||||
{
|
||||
ClipBlock* c = new ClipBlock();
|
||||
|
||||
// Duplicate connection
|
||||
// FIXME: This behavior should probably be configurable
|
||||
if (texture_input()->IsConnected()) {
|
||||
NodeParam::ConnectEdge(texture_input()->edges().first()->output(), c->texture_input());
|
||||
}
|
||||
c->set_block_name(block_name());
|
||||
c->set_length(length());
|
||||
|
||||
return new ClipBlock();
|
||||
return c;
|
||||
}
|
||||
|
||||
Block::Type ClipBlock::type()
|
||||
|
||||
@@ -26,7 +26,12 @@ GapBlock::GapBlock()
|
||||
|
||||
Block *GapBlock::copy()
|
||||
{
|
||||
return new GapBlock();
|
||||
GapBlock* c = new GapBlock();
|
||||
|
||||
c->set_block_name(block_name());
|
||||
c->set_length(length());
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
Block::Type GapBlock::type()
|
||||
|
||||
@@ -59,7 +59,11 @@ void TimelineViewBlockItem::UpdateRect()
|
||||
setRect(0, y_, item_width - 1, height_ - 1);
|
||||
setPos(item_left, 0.0);
|
||||
|
||||
update();
|
||||
// FIXME: Untranslated
|
||||
setToolTip(QString("%1\n\nIn: %2\nOut: %3\nMedia In: %4").arg(block_->Name(),
|
||||
QString::number(block_->in().toDouble()),
|
||||
QString::number(block_->out().toDouble()),
|
||||
QString::number(block_->media_in().toDouble())));
|
||||
}
|
||||
|
||||
void TimelineViewBlockItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
|
||||
@@ -22,12 +22,14 @@
|
||||
|
||||
#include "node/graph.h"
|
||||
|
||||
#include <QDebug>
|
||||
Block* CreateSplitBlock(Block* block, rational point, QObject* parent = nullptr)
|
||||
{
|
||||
Block* copy = block->copy();
|
||||
copy->set_length_and_media_in(block->length() - (point - block->in()));
|
||||
copy->setParent(parent);
|
||||
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user