Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

fix placing macro fx (#2622)

shun-iwasawa7e83f5434ad3
diff --git a/toonz/sources/toonzqt/fxschematicscene.cpp b/toonz/sources/toonzqt/fxschematicscene.cpp
index dfb2b0166..2ada469f5 100644
--- a/toonz/sources/toonzqt/fxschematicscene.cpp
+++ b/toonz/sources/toonzqt/fxschematicscene.cpp
@@ -729,7 +729,14 @@ void FxSchematicScene::placeNode(FxSchematicNode *node) {
maxY = std::max(fx->getAttributes()->getDagNodePos().y, maxY);
}
if (QPointF(minX, minY) == QPointF(TConst::nowhere.x, TConst::nowhere.y)) {
- pos = sceneRect().center();
+ TFx *inputFx = node->getFx()->getInputPort(0)->getFx();
+ if (inputFx &&
+ inputFx->getAttributes()->getDagNodePos() != TConst::nowhere) {
+ TPointD dagPos =
+ inputFx->getAttributes()->getDagNodePos() + TPointD(150, 0);
+ pos = QPointF(dagPos.x, dagPos.y);
+ } else
+ pos = sceneRect().center();
nodeRect.moveTopLeft(pos);
while (!isAnEmptyZone(nodeRect)) nodeRect.translate(0, -step);
pos = nodeRect.topLeft();