Skip to content

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

C

fix pinch tool crash (#2069)

shun-iwasawad8eb6b766fa7
diff --git a/toonz/sources/tnztools/pinchtool.cpp b/toonz/sources/tnztools/pinchtool.cpp
index cc8545bdc..e164da8f0 100644
--- a/toonz/sources/tnztools/pinchtool.cpp
+++ b/toonz/sources/tnztools/pinchtool.cpp
@@ -376,6 +376,15 @@ void PinchTool::onLeave() {
void PinchTool::onImageChanged() {
m_status.stroke2change_ = 0;
m_deformation->reset();
+ // m_active may be true if the frame switched while dragging
+ if (m_active) {
+ m_deformation->deactivate();
+ m_active = false;
+ if (m_undo) {
+ delete m_undo;
+ m_undo = 0;
+ }
+ }
double w = 0;
TStroke *stroke = getClosestStroke(m_lastMouseEvent.m_pos, w);
@@ -529,7 +538,7 @@ bool PinchTool::keyDown(QKeyEvent *event) {
}
}
#endif
- return true;
+ return false;
}
//-----------------------------------------------------------------------------