fix alt drag fx insertion

This commit is contained in:
shun-iwasawa 2021-03-18 19:29:35 +09:00 committed by manongjohn
parent 3638349286
commit 589ae93f6b

View file

@ -626,7 +626,7 @@ void FxSchematicScene::updatePosition(FxSchematicNode *node,
//------------------------------------------------------------------ //------------------------------------------------------------------
/*! create node depends on the fx type /*! create node depends on the fx type
*/ */
FxSchematicNode *FxSchematicScene::createFxSchematicNode(TFx *fx) { FxSchematicNode *FxSchematicScene::createFxSchematicNode(TFx *fx) {
if (TLevelColumnFx *lcFx = dynamic_cast<TLevelColumnFx *>(fx)) if (TLevelColumnFx *lcFx = dynamic_cast<TLevelColumnFx *>(fx))
return new FxSchematicColumnNode(this, lcFx); return new FxSchematicColumnNode(this, lcFx);
@ -644,7 +644,7 @@ FxSchematicNode *FxSchematicScene::createFxSchematicNode(TFx *fx) {
//------------------------------------------------------------------ //------------------------------------------------------------------
/*! place nodes of which positions are not specified manually /*! place nodes of which positions are not specified manually
*/ */
void FxSchematicScene::placeNode(FxSchematicNode *node) { void FxSchematicScene::placeNode(FxSchematicNode *node) {
if (!node) return; if (!node) return;
int step = m_gridDimension == eLarge ? 100 : 50; int step = m_gridDimension == eLarge ? 100 : 50;
@ -1935,14 +1935,15 @@ void FxSchematicScene::simulateDisconnectSelection(bool disconnect) {
void FxSchematicScene::simulateInsertSelection(SchematicLink *link, void FxSchematicScene::simulateInsertSelection(SchematicLink *link,
bool connect) { bool connect) {
if (!link || !connect) { // first, remove all connected links
m_connectionLinks.showBridgeLinks(); m_connectionLinks.showBridgeLinks();
m_connectionLinks.hideInputLinks(); m_connectionLinks.hideInputLinks();
m_connectionLinks.hideOutputLinks(); m_connectionLinks.hideOutputLinks();
m_connectionLinks.removeBridgeLinks(); m_connectionLinks.removeBridgeLinks();
m_connectionLinks.removeInputLinks(true); m_connectionLinks.removeInputLinks(true);
m_connectionLinks.removeOutputLinks(true); m_connectionLinks.removeOutputLinks(true);
} else { if (!link || !connect) return;
if (m_disconnectionLinks.isABridgeLink(link) || m_selection->isEmpty()) if (m_disconnectionLinks.isABridgeLink(link) || m_selection->isEmpty())
return; return;
@ -1985,11 +1986,11 @@ void FxSchematicScene::simulateInsertSelection(SchematicLink *link,
m_connectionLinks.showInputLinks(); m_connectionLinks.showInputLinks();
m_connectionLinks.showOutputLinks(); m_connectionLinks.showOutputLinks();
}
} }
//------------------------------------------------------------ //------------------------------------------------------------
/*! in order to select nods after pasting the copied fx nodes from FxSelection /*! in order to select nods after pasting the copied fx nodes from FxSelection
*/ */
void FxSchematicScene::selectNodes(QList<TFxP> &fxs) { void FxSchematicScene::selectNodes(QList<TFxP> &fxs) {
clearSelection(); clearSelection();
for (int i = 0; i < (int)fxs.size(); i++) { for (int i = 0; i < (int)fxs.size(); i++) {