From 11adda4885f7e60276f377c233c9e4d1be828e72 Mon Sep 17 00:00:00 2001 From: shun-iwasawa Date: Nov 12 2018 09:58:53 +0000 Subject: fix playback slowness with style editor (#2367) --- diff --git a/toonz/sources/toonzlib/tpalettehandle.cpp b/toonz/sources/toonzlib/tpalettehandle.cpp index f1d5770..8937b21 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.cpp index 2f3717b..fa4df3f 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); } //-----------------------------------------------------------------------------