From 760cdf1a859c869a92151997cc908211323452f4 Mon Sep 17 00:00:00 2001
From: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Date: Jun 15 2016 06:09:56 +0000
Subject: fix crash on clicking xsheet (#445)



---

diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cpp
index 1d499c5..8700d1d 100644
--- a/toonz/sources/toonz/xshcellviewer.cpp
+++ b/toonz/sources/toonz/xshcellviewer.cpp
@@ -797,6 +797,9 @@ void CellArea::drawCells(QPainter &p, const QRect toBeUpdated)
 	}
 
 	// smart tab
+	// initialize the rectangles first
+	m_levelExtenderRect = QRect();
+	m_upperLevelExtenderRect = QRect();
 	int smartTabPosOffset = (Preferences::instance()->isShowKeyframesOnXsheetCellAreaEnabled()) ? 31 : 20;
 	if (!cellSelection->isEmpty() && !m_viewer->areSoundCellsSelected()) {
 		m_levelExtenderRect = QRect(xS1 - smartTabPosOffset, yS1 + 1, 19, 8);