From 7b95436a93e5b289609132e2da0305ac8a86fafa Mon Sep 17 00:00:00 2001 From: manongjohn Date: Dec 26 2018 02:03:58 +0000 Subject: Fix eraser mode switch crash (#2396) --- diff --git a/toonz/sources/tnztools/vectorerasertool.cpp b/toonz/sources/tnztools/vectorerasertool.cpp index 2986220..9ea979c 100644 --- a/toonz/sources/tnztools/vectorerasertool.cpp +++ b/toonz/sources/tnztools/vectorerasertool.cpp @@ -834,6 +834,7 @@ void EraserTool::leftButtonDrag(const TPointD &pos, const TMouseEvent &e) { invalidate(); return; } else if (m_eraseType.getValue() == NORMAL_ERASE) { + if (!m_undo) leftButtonDown(pos, e); if (TVectorImageP vi = image) erase(vi, pos); } else if (m_eraseType.getValue() == FREEHAND_ERASE) { freehandDrag(pos); @@ -937,9 +938,10 @@ void EraserTool::leftButtonUp(const TPointD &pos, const TMouseEvent &e) { TTool::Application *application = TTool::getApplication(); if (!vi || !application) return; - if (m_eraseType.getValue() == NORMAL_ERASE) + if (m_eraseType.getValue() == NORMAL_ERASE) { + if (!m_undo) leftButtonDown(pos, e); stopErase(vi); - else if (m_eraseType.getValue() == RECT_ERASE) { + } else if (m_eraseType.getValue() == RECT_ERASE) { if (m_selectingRect.x0 > m_selectingRect.x1) std::swap(m_selectingRect.x1, m_selectingRect.x0); if (m_selectingRect.y0 > m_selectingRect.y1)