Skip to content

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

C

Corrected logic for empty cells

manongjohnf3163f8dfce7
diff --git a/toonz/sources/tnztools/tool.cpp b/toonz/sources/tnztools/tool.cpp
index 17b8fb8c6..5325ed07c 100644
--- a/toonz/sources/tnztools/tool.cpp
+++ b/toonz/sources/tnztools/tool.cpp
@@ -801,7 +801,8 @@ QString TTool::updateEnabled(int rowIndex, int columnIndex) {
// If not in Level editor, let's use our current cell from the xsheet to
// find the nearest level before it
- if (!m_application->getCurrentFrame()->isEditingLevel()) {
+ if (levelType == NO_XSHLEVEL &&
+ !m_application->getCurrentFrame()->isEditingLevel()) {
TXshCell cell = xsh->getCell(rowIndex, columnIndex);
xl = cell.isEmpty() ? 0 : (TXshLevel *)(&cell.m_level);
sl = cell.isEmpty() ? 0 : cell.getSimpleLevel();
diff --git a/toonz/sources/toonz/toolbar.cpp b/toonz/sources/toonz/toolbar.cpp
index 4938915ce..727091211 100755
--- a/toonz/sources/toonz/toolbar.cpp
+++ b/toonz/sources/toonz/toolbar.cpp
@@ -118,6 +118,12 @@ void Toolbar::updateToolbar(bool forceReset) {
rowIndex = r;
break;
}
+
+ if (levelType == NO_XSHLEVEL) {
+ TXshCell cell = xsh->getCell(r0, colIndex);
+ levelType = cell.m_level->getType();
+ rowIndex = r0;
+ }
}
}
}