OpenToonz - An open-source full-featured 2D animation creation software
C
fix playback slowness with style editor (#2367)
shun-iwasawa11adda4885f7
diff --git a/toonz/sources/toonzlib/tpalettehandle.cpp b/toonz/sources/toonzlib/tpalettehandle.cppindex f1d5770b6..8937b21e2 100644--- a/toonz/sources/toonzlib/tpalettehandle.cpp+++ b/toonz/sources/toonzlib/tpalettehandle.cpp@@ -144,12 +144,11 @@ void TPaletteHandle::setPalette(TPalette *palette, int styleIndex) {//-----------------------------------------------------------------------------void TPaletteHandle::setStyleIndex(int index) {- // if(m_styleIndex != index)- // {- m_styleIndex = index;- m_styleParamIndex = 0;- emit broadcastColorStyleSwitched();- // }+ if (m_styleIndex != index || m_styleParamIndex != 0) {+ m_styleIndex = index;+ m_styleParamIndex = 0;+ emit broadcastColorStyleSwitched();+ }}//-----------------------------------------------------------------------------diff --git a/toonz/sources/toonzqt/styleeditor.cpp b/toonz/sources/toonzqt/styleeditor.cppindex 2f3717b42..fa4df3ffb 100644--- a/toonz/sources/toonzqt/styleeditor.cpp+++ b/toonz/sources/toonzqt/styleeditor.cpp@@ -3254,9 +3254,9 @@ void StyleEditor::showEvent(QShowEvent *) {//-----------------------------------------------------------------------------void StyleEditor::hideEvent(QHideEvent *) {- disconnect(m_paletteHandle);- if (m_cleanupPaletteHandle) disconnect(m_cleanupPaletteHandle);- disconnect(m_paletteController);+ disconnect(m_paletteHandle, 0, this, 0);+ if (m_cleanupPaletteHandle) disconnect(m_cleanupPaletteHandle, 0, this, 0);+ disconnect(m_paletteController, 0, this, 0);}//-----------------------------------------------------------------------------