From 195b543b9d0d189d58d0b61ff42bce9ec5923494 Mon Sep 17 00:00:00 2001 From: manongjohn Date: Sun, 2 Jan 2022 14:01:26 -0500 Subject: [PATCH 1/8] Fix Tahoma2D shortcut preset file reference --- toonz/sources/toonzlib/preferences.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toonz/sources/toonzlib/preferences.cpp b/toonz/sources/toonzlib/preferences.cpp index 89d41d76..76ebf960 100644 --- a/toonz/sources/toonzlib/preferences.cpp +++ b/toonz/sources/toonzlib/preferences.cpp @@ -654,7 +654,7 @@ void Preferences::definePreferenceItems() { // Others (not appeared in the popup) // Shortcut popup settings - define(shortcutPreset, "shortcutPreset", QMetaType::QString, "defopentoonz"); + define(shortcutPreset, "shortcutPreset", QMetaType::QString, "deftahoma2d"); // Viewer context menu define(guidedDrawingType, "guidedDrawingType", QMetaType::Int, 0); // Off define(guidedAutoInbetween, "guidedAutoInbetween", QMetaType::Bool, From ac08e3e2b1417276450e434b9e15581b20e79843 Mon Sep 17 00:00:00 2001 From: manongjohn Date: Sun, 2 Jan 2022 14:12:35 -0500 Subject: [PATCH 2/8] Fix setting to default "- No Level -" in Level Strip --- toonz/sources/toonz/filmstrip.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toonz/sources/toonz/filmstrip.cpp b/toonz/sources/toonz/filmstrip.cpp index 59c9d176..52f5fc61 100644 --- a/toonz/sources/toonz/filmstrip.cpp +++ b/toonz/sources/toonz/filmstrip.cpp @@ -1700,7 +1700,7 @@ void Filmstrip::updateCurrentLevelComboItem() { TXshSimpleLevel *currentLevel = TApp::instance()->getCurrentLevel()->getSimpleLevel(); if (!currentLevel) { - int noLevelIndex = m_chooseLevelCombo->findText(tr("- No Current Level -")); + int noLevelIndex = m_chooseLevelCombo->findText(tr("- No Level -")); m_chooseLevelCombo->setCurrentIndex(noLevelIndex); return; } @@ -1718,7 +1718,7 @@ void Filmstrip::updateCurrentLevelComboItem() { } } - int noLevelIndex = m_chooseLevelCombo->findText(tr("- No Current Level -")); + int noLevelIndex = m_chooseLevelCombo->findText(tr("- No Level -")); m_chooseLevelCombo->setCurrentIndex(noLevelIndex); } From 0fca851ac7b0c38a27a8de0dc4572eebf992690b Mon Sep 17 00:00:00 2001 From: manongjohn Date: Sun, 2 Jan 2022 15:11:46 -0500 Subject: [PATCH 3/8] Fix Redo of Cut empty only cells --- toonz/sources/toonz/cellselection.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/toonz/sources/toonz/cellselection.cpp b/toonz/sources/toonz/cellselection.cpp index 4a5a6a8c..7a65265d 100644 --- a/toonz/sources/toonz/cellselection.cpp +++ b/toonz/sources/toonz/cellselection.cpp @@ -111,12 +111,14 @@ void copyCellsWithoutUndo(int r0, int c0, int r1, int c1) { bool pasteCellsWithoutUndo(const TCellData *cellData, int &r0, int &c0, int &r1, int &c1, bool insert = true, - bool doZeraryClone = true) { + bool doZeraryClone = true, + bool skipEmptyCells = true) { TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet(); if (!cellData) return false; if (r0 < 0 || c0 < 0) return false; - bool ret = cellData->getCells(xsh, r0, c0, r1, c1, insert, doZeraryClone); + bool ret = cellData->getCells(xsh, r0, c0, r1, c1, insert, doZeraryClone, + skipEmptyCells); if (!ret) return false; return true; @@ -360,7 +362,7 @@ public: int r0, c0, r1, c1; m_selection->getSelectedCells(r0, c0, r1, c1); - pasteCellsWithoutUndo(m_data, r0, c0, r1, c1, true); + pasteCellsWithoutUndo(m_data, r0, c0, r1, c1, true, true, false); TApp::instance()->getCurrentXsheet()->notifyXsheetChanged(); } From 62c8f50c3a3354fc72179776db875014d3dd7023 Mon Sep 17 00:00:00 2001 From: manongjohn Date: Sun, 2 Jan 2022 16:20:26 -0500 Subject: [PATCH 4/8] Fix undo New Level creation in blank cells between populated cells --- toonz/sources/toonz/levelcreatepopup.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/toonz/sources/toonz/levelcreatepopup.cpp b/toonz/sources/toonz/levelcreatepopup.cpp index 1e6c08a7..95e12145 100644 --- a/toonz/sources/toonz/levelcreatepopup.cpp +++ b/toonz/sources/toonz/levelcreatepopup.cpp @@ -96,8 +96,11 @@ public: TXsheet *xsh = scene->getXsheet(); if (m_areColumnsShifted) xsh->removeColumn(m_columnIndex); - else if (m_frameCount > 0) + else if (m_frameCount > 0) { + // remove the cells and add back blank ones xsh->removeCells(m_rowIndex, m_columnIndex, m_frameCount); + xsh->insertCells(m_rowIndex, m_columnIndex, m_frameCount); + } TLevelSet *levelSet = scene->getLevelSet(); if (levelSet) { From 5d63cd28989572b2820125458e57eaf3ef14f882 Mon Sep 17 00:00:00 2001 From: manongjohn Date: Sun, 2 Jan 2022 17:59:59 -0500 Subject: [PATCH 5/8] Ignore Each # action when range selection is less than Each # --- toonz/sources/toonz/cellselectioncommand.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/toonz/sources/toonz/cellselectioncommand.cpp b/toonz/sources/toonz/cellselectioncommand.cpp index ba3f9fbf..40a45780 100644 --- a/toonz/sources/toonz/cellselectioncommand.cpp +++ b/toonz/sources/toonz/cellselectioncommand.cpp @@ -544,6 +544,9 @@ void EachUndo::undo() const { void TCellSelection::eachCells(int each) { if (isEmpty() || areAllColSelectedLocked()) return; + // Do nothing if they select less than Each # + if ((m_range.m_r1 - m_range.m_r0 + 1) < each) return; + TUndo *undo = new EachUndo(m_range.m_r0, m_range.m_c0, m_range.m_r1, m_range.m_c1, each); TUndoManager::manager()->add(undo); From 929c159b7cf5bddeaffe96c1ce0e5dada07e1e3b Mon Sep 17 00:00:00 2001 From: manongjohn Date: Tue, 11 Jan 2022 12:29:19 -0500 Subject: [PATCH 6/8] Fix Dragbar to start inside cell instead of over frame --- toonz/sources/toonz/xshcellviewer.cpp | 79 ++++++++++++++++++++------- toonz/sources/toonz/xshcellviewer.h | 6 +- 2 files changed, 61 insertions(+), 24 deletions(-) diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cpp index 6ac34ee1..7791cb35 100644 --- a/toonz/sources/toonz/xshcellviewer.cpp +++ b/toonz/sources/toonz/xshcellviewer.cpp @@ -1594,6 +1594,8 @@ void CellArea::drawSoundCell(QPainter &p, int row, int col, bool isReference) { int maxNumFrame = soundColumn->getMaxFrame() + 1; int startFrame = soundColumn->getFirstRow(); TXshCell cell = soundColumn->getSoundCell(row); + TXshCell prevCell; + if (row > 0) prevCell = soundColumn->getSoundCell(row - 1); if (soundColumn->isCellEmpty(row) || cell.isEmpty() || row > maxNumFrame || row < startFrame) { drawCellMarker(p, markId, rect, false, isNextEmpty); @@ -1614,7 +1616,7 @@ void CellArea::drawSoundCell(QPainter &p, int row, int col, bool isReference) { drawCellMarker(p, markId, rect, true, isNextEmpty); return; } - bool isFirstRow = (row == r0); + bool isFirstRow = (row > 0 && row == r0); bool isLastRow = (row == r1); TCellSelection *cellSelection = m_viewer->getCellSelection(); @@ -1653,9 +1655,9 @@ void CellArea::drawSoundCell(QPainter &p, int row, int col, bool isReference) { Preferences::instance()->isCurrentTimelineIndicatorEnabled()) drawCurrentTimeIndicator(p, xy); - drawDragHandle(p, xy, sideColor); + drawDragHandle(p, isFirstRow, xy, sideColor); drawEndOfDragHandle(p, isLastRow, xy, cellColor); - drawLockedDottedLine(p, soundColumn->isLocked(), xy, cellColor); + drawLockedDottedLine(p, soundColumn->isLocked(), isFirstRow, xy, cellColor); QRect trackRect = o->rect(PredefinedRect::SOUND_TRACK) .adjusted(0, 0, -frameAdj.x(), -frameAdj.y()) @@ -1762,13 +1764,19 @@ void CellArea::drawSoundCell(QPainter &p, int row, int col, bool isReference) { //----------------------------------------------------------------------------- // paint side bar -void CellArea::drawDragHandle(QPainter &p, const QPoint &xy, +void CellArea::drawDragHandle(QPainter &p, bool isStart, const QPoint &xy, const QColor &sideColor) const { QPoint frameAdj = m_viewer->getFrameZoomAdjustment(); QRect dragHandleRect = m_viewer->orientation() ->rect(PredefinedRect::DRAG_HANDLE_CORNER) .adjusted(0, 0, -frameAdj.x(), -frameAdj.y()) .translated(xy); + if (isStart) { + if (m_viewer->orientation()->isVerticalTimeline()) + dragHandleRect.adjust(0, 1, 0, 0); + else + dragHandleRect.adjust(1, 0, 0, 0); + } p.fillRect(dragHandleRect, QBrush(sideColor)); } @@ -1784,7 +1792,7 @@ void CellArea::drawEndOfDragHandle(QPainter &p, bool isEnd, const QPoint &xy, } // draw dot line if the column is locked -void CellArea::drawLockedDottedLine(QPainter &p, bool isLocked, +void CellArea::drawLockedDottedLine(QPainter &p, bool isLocked, bool isStart, const QPoint &xy, const QColor &cellColor) const { if (!isLocked) return; @@ -1792,6 +1800,12 @@ void CellArea::drawLockedDottedLine(QPainter &p, bool isLocked, QPoint frameAdj = m_viewer->getFrameZoomAdjustment(); QLine dottedLine = m_viewer->orientation()->line(PredefinedLine::LOCKED).translated(xy); + if (isStart) { + if (m_viewer->orientation()->isVerticalTimeline()) + dottedLine.setP1(QPoint(dottedLine.x1(), dottedLine.y1() + 2)); + else + dottedLine.setP1(QPoint(dottedLine.x1() + 2, dottedLine.y1())); + } dottedLine.setP2(QPoint(dottedLine.x2(), dottedLine.y2()) - frameAdj); p.drawLine(dottedLine); } @@ -2109,13 +2123,15 @@ void CellArea::drawLevelCell(QPainter &p, int row, int col, bool isReference, drawCurrentTimeIndicator(p, xy); if (!isImplicitCell) { - drawDragHandle(p, xy, sideColor); + bool isStart = row > 0 && (prevCell.isEmpty() || prevIsImplicit); + drawDragHandle(p, isStart, xy, sideColor); bool isLastRow = nextCell.isEmpty() || cell.m_level.getPointer() != nextCell.m_level.getPointer(); drawEndOfDragHandle(p, isLastRow, xy, cellColor); - drawLockedDottedLine(p, xsh->getColumn(col)->isLocked(), xy, cellColor); + drawLockedDottedLine(p, xsh->getColumn(col)->isLocked(), isStart, xy, + cellColor); } int distance, offset; @@ -2261,14 +2277,18 @@ void CellArea::drawSoundTextCell(QPainter &p, int row, int col) { TXsheet *xsh = m_viewer->getXsheet(); TXshCell cell = xsh->getCell(row, col); TXshCell prevCell; + bool prevIsImplicit = false; TCellSelection *cellSelection = m_viewer->getCellSelection(); TColumnSelection *columnSelection = m_viewer->getColumnSelection(); bool isSelected = cellSelection->isCellSelected(row, col) || columnSelection->isColumnSelected(col); - if (row > 0) prevCell = xsh->getCell(row - 1, col); // cell in previous frame - // nothing to draw + if (row > 0) { + prevCell = xsh->getCell(row - 1, col); // cell in previous frame + // nothing to draw + prevIsImplicit = xsh->isImplicitCell(row - 1, col); + } bool sameLevel = prevCell.m_level.getPointer() == cell.m_level.getPointer(); @@ -2350,13 +2370,15 @@ void CellArea::drawSoundTextCell(QPainter &p, int row, int col) { Preferences::instance()->isCurrentTimelineIndicatorEnabled()) drawCurrentTimeIndicator(p, xy); - drawDragHandle(p, xy, sideColor); + bool isStart = row > 0 && (prevCell.isEmpty() || prevIsImplicit); + drawDragHandle(p, isStart, xy, sideColor); bool isLastRow = nextCell.isEmpty() || cell.m_level.getPointer() != nextCell.m_level.getPointer(); drawEndOfDragHandle(p, isLastRow, xy, cellColor); - drawLockedDottedLine(p, xsh->getColumn(col)->isLocked(), xy, cellColor); + drawLockedDottedLine(p, xsh->getColumn(col)->isLocked(), isStart, xy, + cellColor); TFrameId fid = cell.m_frameId; if (fid.getNumber() - 1 < 0) return; @@ -2455,7 +2477,8 @@ void CellArea::drawSoundTextColumn(QPainter &p, int r0, int r1, int col) { TXshCell nextCell = xsh->getCell(r + 1, col); ret.isEndOfRange = nextCell.isEmpty(); ret.rect = cellRect.adjusted( - (!m_viewer->orientation()->isVerticalTimeline() && r == 0 ? 0 : 1), 1, + (!m_viewer->orientation()->isVerticalTimeline() && r == 0 ? 0 : 1), + (m_viewer->orientation()->isVerticalTimeline() && r == 0 ? 0 : 1), (!m_viewer->orientation()->isVerticalTimeline() && !nextCell.isEmpty() ? 2 : 0), @@ -2515,14 +2538,19 @@ void CellArea::drawSoundTextColumn(QPainter &p, int r0, int r1, int col) { for (int row = rStart; row <= rEnd; row++) { TXshCell cell = xsh->getCell(row, col); + TXshCell prevCell; + bool prevIsImplicit = false; + if (row > 0) { + prevCell = xsh->getCell(row - 1, col); + prevIsImplicit = xsh->isImplicitCell(row - 1, col); + } + // if the cell is empty if (cell.isEmpty()) { CellInfo info = getCellInfo(row); // cell mark drawCellMarker(p, info.markId, info.rect); // draw X shape after the occupied cell - TXshCell prevCell; - if (row > 0) prevCell = xsh->getCell(row - 1, col); if (!prevCell.isEmpty()) drawEndOfLevelMarker(p, info.rect); drawFrameSeparator(p, row, col, true); if (TApp::instance()->getCurrentFrame()->isEditingScene() && @@ -2537,7 +2565,8 @@ void CellArea::drawSoundTextColumn(QPainter &p, int r0, int r1, int col) { QList infoList; // check how long the same content continues - int rowTo = row; + int rowFrom = row; + int rowTo = row; infoList.append(getCellInfo(row)); while (xsh->getCell(rowTo + 1, col) == cell) { rowTo++; @@ -2573,9 +2602,11 @@ void CellArea::drawSoundTextColumn(QPainter &p, int r0, int r1, int col) { Preferences::instance()->isCurrentTimelineIndicatorEnabled()) drawCurrentTimeIndicator(p, info.xy); - drawDragHandle(p, info.xy, sideColor); + bool isStart = row > 0 && (prevCell.isEmpty() || prevIsImplicit || + info.row == rowFrom); + drawDragHandle(p, isStart, info.xy, sideColor); drawEndOfDragHandle(p, info.isEndOfRange, info.xy, tmpCellColor); - drawLockedDottedLine(p, xsh->getColumn(col)->isLocked(), info.xy, + drawLockedDottedLine(p, xsh->getColumn(col)->isLocked(), isStart, info.xy, tmpCellColor); } @@ -2691,14 +2722,18 @@ void CellArea::drawPaletteCell(QPainter &p, int row, int col, TXsheet *xsh = m_viewer->getXsheet(); TXshCell cell = xsh->getCell(row, col); TXshCell prevCell; + bool prevIsImplicit = false; TCellSelection *cellSelection = m_viewer->getCellSelection(); bool isSelected = cellSelection->isCellSelected(row, col); bool isImplicitCell = xsh->isImplicitCell(row, col); bool isStopFrame = isImplicitCell ? false : cell.getFrameId().isStopFrame(); - if (row > 0) prevCell = xsh->getCell(row - 1, col); - TXshCell nextCell = xsh->getCell(row + 1, col); + if (row > 0) { + prevCell = xsh->getCell(row - 1, col); + prevIsImplicit = xsh->isImplicitCell(row - 1, col); + } + TXshCell nextCell = xsh->getCell(row + 1, col); bool isImplicitCellNext = xsh->isImplicitCell(row + 1, col); bool sameLevel = prevCell.m_level.getPointer() == cell.m_level.getPointer(); @@ -2817,11 +2852,13 @@ void CellArea::drawPaletteCell(QPainter &p, int row, int col, drawCurrentTimeIndicator(p, xy); if (!isImplicitCell) { - drawDragHandle(p, xy, sideColor); + bool isStart = row > 0 && (prevCell.isEmpty() || prevIsImplicit); + drawDragHandle(p, isStart, xy, sideColor); bool isLastRow = nextCell.isEmpty() || cell.m_level.getPointer() != nextCell.m_level.getPointer(); drawEndOfDragHandle(p, isLastRow, xy, cellColor); - drawLockedDottedLine(p, xsh->getColumn(col)->isLocked(), xy, cellColor); + drawLockedDottedLine(p, xsh->getColumn(col)->isLocked(), isStart, xy, + cellColor); } if (o->isVerticalTimeline() && isAfterMarkers) { diff --git a/toonz/sources/toonz/xshcellviewer.h b/toonz/sources/toonz/xshcellviewer.h index f6934d84..cc136a73 100644 --- a/toonz/sources/toonz/xshcellviewer.h +++ b/toonz/sources/toonz/xshcellviewer.h @@ -103,12 +103,12 @@ class CellArea final : public QWidget { void drawSelectionBackground(QPainter &p) const; void drawExtenderHandles(QPainter &p); - void drawDragHandle(QPainter &p, const QPoint &xy, + void drawDragHandle(QPainter &p, bool isStart, const QPoint &xy, const QColor &sideColor) const; void drawEndOfDragHandle(QPainter &p, bool isEnd, const QPoint &xy, const QColor &cellColor) const; - void drawLockedDottedLine(QPainter &p, bool isLocked, const QPoint &xy, - const QColor &cellColor) const; + void drawLockedDottedLine(QPainter &p, bool isLocked, bool isStart, + const QPoint &xy, const QColor &cellColor) const; void drawFrameSeparator(QPainter &p, int row, int col, bool emptyFrame, bool heldFrame = false); From 15cc515e89b6fb5f754031ae781a4369767a43ea Mon Sep 17 00:00:00 2001 From: manongjohn Date: Wed, 12 Jan 2022 11:27:24 -0500 Subject: [PATCH 7/8] Fix PSD column load Undo --- toonz/sources/toonz/iocommand.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toonz/sources/toonz/iocommand.cpp b/toonz/sources/toonz/iocommand.cpp index b996178b..7c44e5a8 100644 --- a/toonz/sources/toonz/iocommand.cpp +++ b/toonz/sources/toonz/iocommand.cpp @@ -329,8 +329,8 @@ bool beforeCellsInsert(TXsheet *xsh, int row, int &col, int rowCount, int type = (column && !column->isEmpty()) ? column->getColumnType() : newLevelColumnType; // If some used cells in range or column type mismatch must insert a column. - if (col < 0 || i < rowCount || newLevelColumnType != type) { - col += 1; + if (col < 0 || i < rowCount || newLevelColumnType != type || !column) { + if (column) col += 1; TApp::instance()->getCurrentColumn()->setColumnIndex(col); shiftColumn = true; xsh->insertColumn(col); From 58a6a2a52fe7c0d5f13f1e4d71a30bae120aad94 Mon Sep 17 00:00:00 2001 From: manongjohn Date: Fri, 14 Jan 2022 17:50:52 -0500 Subject: [PATCH 8/8] Fix X in end of level cells and stop frames --- toonz/sources/toonz/xshcellviewer.cpp | 41 ++++++++++++++++++--------- toonz/sources/toonz/xshcellviewer.h | 3 +- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cpp index 7791cb35..bfff4bed 100644 --- a/toonz/sources/toonz/xshcellviewer.cpp +++ b/toonz/sources/toonz/xshcellviewer.cpp @@ -1875,21 +1875,30 @@ void CellArea::drawFrameMarker(QPainter &p, const QPoint &xy, QColor color, //----------------------------------------------------------------------------- -void CellArea::drawEndOfLevelMarker(QPainter &p, QRect rect, bool isStopFrame) { +void CellArea::drawEndOfLevelMarker(QPainter &p, QRect rect, bool isNextEmpty, + bool isStopFrame) { const Orientation *o = m_viewer->orientation(); QColor levelEndColor = m_viewer->getTextColor(); QPoint topLeft = rect.topLeft(); QPoint topRight = rect.topRight(); - if (!o->isVerticalTimeline() && isStopFrame) { - QRect dragRect = o->rect(PredefinedRect::DRAG_AREA); - topLeft.setY(topLeft.y() + dragRect.height()); - topRight.setY(topRight.y() + dragRect.height()); + QPoint bottomLeft = rect.bottomLeft(); + QPoint bottomRight = rect.bottomRight(); + if (!o->isVerticalTimeline()) { + if (isStopFrame) { + QRect dragRect = o->rect(PredefinedRect::DRAG_AREA); + topLeft.setY(topLeft.y() + dragRect.height()); + topRight.setY(topRight.y() + dragRect.height()); + } + if (!isNextEmpty) { + topRight.setX(topRight.x() - 2); + bottomRight.setX(bottomRight.x() - 2); + } } levelEndColor.setAlphaF(0.3); p.setPen(levelEndColor); - p.drawLine(topLeft, rect.bottomRight()); - p.drawLine(topRight, rect.bottomLeft()); + p.drawLine(topLeft, bottomRight); + p.drawLine(topRight, bottomLeft); } //----------------------------------------------------------------------------- @@ -2052,7 +2061,7 @@ void CellArea::drawLevelCell(QPainter &p, int row, int col, bool isReference, // Implicit holds use Stop Frame Hold to denote end of level if (!Preferences::instance()->isImplicitHoldEnabled()) - drawEndOfLevelMarker(p, rect); + drawEndOfLevelMarker(p, rect, nextCell.isEmpty() || isImplicitCellNext); drawFrameSeparator(p, row, col, false, heldFrame); @@ -2112,7 +2121,9 @@ void CellArea::drawLevelCell(QPainter &p, int row, int col, bool isReference, nextCell.isEmpty() || isImplicitCellNext); // Implicit holds use Stop Frame Hold to denote end of level - if (isStopFrame) drawEndOfLevelMarker(p, rect, true); + if (isStopFrame) + drawEndOfLevelMarker(p, rect, nextCell.isEmpty() || isImplicitCellNext, + true); drawFrameSeparator(p, row, col, false, heldFrame); @@ -2332,7 +2343,7 @@ void CellArea::drawSoundTextCell(QPainter &p, int row, int col) { // cell mark drawCellMarker(p, markId, rect); - drawEndOfLevelMarker(p, rect); + drawEndOfLevelMarker(p, rect, nextCell.isEmpty()); drawFrameSeparator(p, row, col, false, heldFrame); @@ -2544,6 +2555,7 @@ void CellArea::drawSoundTextColumn(QPainter &p, int r0, int r1, int col) { prevCell = xsh->getCell(row - 1, col); prevIsImplicit = xsh->isImplicitCell(row - 1, col); } + TXshCell nextCell = xsh->getCell(row + 1, col); // if the cell is empty if (cell.isEmpty()) { @@ -2551,7 +2563,8 @@ void CellArea::drawSoundTextColumn(QPainter &p, int r0, int r1, int col) { // cell mark drawCellMarker(p, info.markId, info.rect); // draw X shape after the occupied cell - if (!prevCell.isEmpty()) drawEndOfLevelMarker(p, info.rect); + if (!prevCell.isEmpty()) + drawEndOfLevelMarker(p, info.rect, nextCell.isEmpty()); drawFrameSeparator(p, row, col, true); if (TApp::instance()->getCurrentFrame()->isEditingScene() && !m_viewer->orientation()->isVerticalTimeline() && @@ -2801,7 +2814,7 @@ void CellArea::drawPaletteCell(QPainter &p, int row, int col, // Implicit holds use Stop Frame Hold to denote end of level if (!Preferences::instance()->isImplicitHoldEnabled()) - drawEndOfLevelMarker(p, rect); + drawEndOfLevelMarker(p, rect, nextCell.isEmpty() || isImplicitCellNext); drawFrameSeparator(p, row, col, false, heldFrame); @@ -2841,7 +2854,9 @@ void CellArea::drawPaletteCell(QPainter &p, int row, int col, nextCell.isEmpty() || isImplicitCellNext); // Implicit holds use Stop Frame Hold to denote end of level - if (isStopFrame) drawEndOfLevelMarker(p, rect, true); + if (isStopFrame) + drawEndOfLevelMarker(p, rect, nextCell.isEmpty() || isImplicitCellNext, + true); drawFrameSeparator(p, row, col, false, heldFrame); diff --git a/toonz/sources/toonz/xshcellviewer.h b/toonz/sources/toonz/xshcellviewer.h index cc136a73..db45710d 100644 --- a/toonz/sources/toonz/xshcellviewer.h +++ b/toonz/sources/toonz/xshcellviewer.h @@ -131,7 +131,8 @@ class CellArea final : public QWidget { void drawFrameMarker(QPainter &p, const QPoint &xy, QColor color, bool isKeyFrame = false, bool isCamera = false); - void drawEndOfLevelMarker(QPainter &p, QRect rect, bool isStopFrame = false); + void drawEndOfLevelMarker(QPainter &p, QRect rect, bool isNextEmpty, + bool isStopFrame = false); void drawCellMarker(QPainter &p, int markId, QRect rect, bool hasFrame = false, bool isNextEmpty = true);