use strings to connect nodes
This makes the node system somewhat more high-level with the intent of making working with them far more flexible and stable. By making the architecture more abstracted, it becomes far less rigid which should allow us to do even more with it and make it much less crash prone.
This commit is contained in:
@@ -31,14 +31,14 @@ KeyframeView::KeyframeView(QWidget *parent) :
|
||||
setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
||||
}
|
||||
|
||||
void KeyframeView::SetElementY(const NodeConnectable::InputConnection &c, int y)
|
||||
void KeyframeView::SetElementY(const NodeInput &c, int y)
|
||||
{
|
||||
qreal scene_y = mapToScene(mapFromGlobal(QPoint(0, y))).y();
|
||||
|
||||
element_y_.insert(c, scene_y);
|
||||
|
||||
for (auto it=item_map().cbegin(); it!=item_map().cend(); it++) {
|
||||
if (it.key()->parent() == c.input && it.key()->element() == c.element) {
|
||||
if (it.key()->key_track_ref().input() == c) {
|
||||
it.value()->SetOverrideY(scene_y);
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ void KeyframeView::SceneRectUpdateEvent(QRectF &rect)
|
||||
KeyframeViewItem* KeyframeView::AddKeyframe(NodeKeyframe* key)
|
||||
{
|
||||
KeyframeViewItem* item = super::AddKeyframe(key);
|
||||
item->SetOverrideY(element_y_.value({key->parent(), key->element()}));
|
||||
item->SetOverrideY(element_y_.value(key->key_track_ref().input()));
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user