From 75d89c435202931ae699b53d80bd163003210737 Mon Sep 17 00:00:00 2001 From: Rodney Date: Sep 12 2021 04:34:44 +0000 Subject: Merge pull request #4059 from shun-iwasawa/g/fix_fxgadget_offset Fix Fx Gadget Offset --- diff --git a/toonz/sources/tnztools/edittoolgadgets.cpp b/toonz/sources/tnztools/edittoolgadgets.cpp index 18bb6d0..fd93749 100644 --- a/toonz/sources/tnztools/edittoolgadgets.cpp +++ b/toonz/sources/tnztools/edittoolgadgets.cpp @@ -2084,6 +2084,15 @@ EditToolGadgets::DragTool *FxGadgetController::createDragTool(int gadgetId) { //--------------------------------------------------------------------------- TAffine FxGadgetController::getMatrix() { + TFx *fx = m_fxHandle ? m_fxHandle->getFx() : 0; + if (fx) { + int referenceColumnIndex = fx->getReferenceColumnIndex(); + if (referenceColumnIndex == -1) + return m_tool->getMatrix().inv(); + else if (referenceColumnIndex != m_tool->getColumnIndex()) + return m_tool->getMatrix().inv() * + m_tool->getColumnMatrix(referenceColumnIndex, -1); + } return m_tool->getMatrix().inv() * m_tool->getCurrentColumnMatrix(); }