diff --git a/toonz/sources/include/orientation.h b/toonz/sources/include/orientation.h index 5da5ba9d..29777a47 100644 --- a/toonz/sources/include/orientation.h +++ b/toonz/sources/include/orientation.h @@ -172,6 +172,7 @@ enum class PredefinedPath { VOLUME_SLIDER_TRACK, //! slider track VOLUME_SLIDER_HEAD, //! slider head TIME_INDICATOR_HEAD, //! current time indicator head + FRAME_MARKER_DIAMOND_SMALL, FRAME_MARKER_DIAMOND, FRAME_MARKER_DIAMOND_LARGE, NAVIGATION_TAG diff --git a/toonz/sources/toonz/Resources/key.svg b/toonz/sources/toonz/Resources/key.svg deleted file mode 100644 index 6302d47a..00000000 --- a/toonz/sources/toonz/Resources/key.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/toonz/sources/toonz/Resources/selected_key.svg b/toonz/sources/toonz/Resources/selected_key.svg deleted file mode 100644 index 09feb87a..00000000 --- a/toonz/sources/toonz/Resources/selected_key.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/toonz/sources/toonz/toonz.qrc b/toonz/sources/toonz/toonz.qrc index 38c3e453..e6c5ac0d 100644 --- a/toonz/sources/toonz/toonz.qrc +++ b/toonz/sources/toonz/toonz.qrc @@ -597,7 +597,6 @@ Resources/iron.png Resources/iconplay.png Resources/iconpause.png - Resources/key.svg Resources/magnet.png Resources/motionpath.svg Resources/motionpath_delete.svg @@ -634,7 +633,6 @@ Resources/schematic_spin_arrows.svg Resources/schematic_spline_aim_rhomb.svg Resources/schematic_spline_aim_square.svg - Resources/selected_key.svg Resources/selection_add.png Resources/selection_convert.png Resources/shear.png diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cpp index 79d238c1..4acc19b6 100644 --- a/toonz/sources/toonz/xshcellviewer.cpp +++ b/toonz/sources/toonz/xshcellviewer.cpp @@ -1898,16 +1898,17 @@ void CellArea::drawFrameMarker(QPainter &p, const QPoint &xy, QColor color, ->rect(PredefinedRect::FRAME_MARKER_AREA) .translated(xy) .translated(-frameAdj / 2); + bool useSmall = + m_viewer->getFrameZoomFactor() <= + m_viewer->orientation()->dimension(PredefinedDimension::SCALE_THRESHOLD); if (isKeyFrame) { - if (isCamera && !m_viewer->orientation()->isVerticalTimeline() && - m_viewer->getFrameZoomFactor() <= - m_viewer->orientation()->dimension( - PredefinedDimension::SCALE_THRESHOLD)) + if (isCamera && !m_viewer->orientation()->isVerticalTimeline()) dotRect.adjust(0, -3, 0, -3); PredefinedPath diamondPath = keyHighlight ? PredefinedPath::FRAME_MARKER_DIAMOND_LARGE - : PredefinedPath::FRAME_MARKER_DIAMOND; + : useSmall ? PredefinedPath::FRAME_MARKER_DIAMOND_SMALL + : PredefinedPath::FRAME_MARKER_DIAMOND; m_viewer->drawPredefinedPath(p, diamondPath, dotRect.adjusted(1, 1, 1, 1).center(), color, outlineColor); @@ -3068,8 +3069,6 @@ void CellArea::drawKeyframe(QPainter &p, const QRect toBeUpdated) { c0 = visible.from().layer(); c1 = visible.to().layer(); - static QPixmap selectedKey = svgToPixmap(":Resources/selected_key.svg"); - static QPixmap key = svgToPixmap(":Resources/key.svg"); QPoint frameAdj = m_viewer->getFrameZoomAdjustment(); const QRect &keyRect = o->rect(PredefinedRect::KEY_ICON).translated(-frameAdj / 2); @@ -3150,46 +3149,27 @@ void CellArea::drawKeyframe(QPainter &p, const QRect toBeUpdated) { if (pegbar->isKeyframe(row)) { QPoint xy = m_viewer->positionToXY(CellPosition(row, col)); QPoint target = tmpKeyRect.translated(xy).topLeft(); + + QColor color = Qt::white; + if (m_viewer->getKeyframeSelection() && + m_viewer->getKeyframeSelection()->isSelected(row, col)) + color = QColor(85, 157, 255); + + int x = xy.x(); + int y = xy.y(); + if (m_viewer->getFrameZoomFactor() <= o->dimension(PredefinedDimension::SCALE_THRESHOLD)) { - QColor color = Qt::white; - int x = xy.x(); - int y = xy.y(); if (row == 0) { if (o->isVerticalTimeline()) xy.setY(xy.y() + 1); else xy.setX(xy.x() + 1); } - - if (m_viewer->getKeyframeSelection() && - m_viewer->getKeyframeSelection()->isSelected(row, col)) - color = QColor(85, 157, 255); - - drawFrameMarker(p, QPoint(x, y), color, true, (col < 0), - (m_keyHighlight == QPoint(row, col))); - - } else { - QPixmap keyPM; - if (o->isVerticalTimeline()) - target = QPoint(target.x() - 2, target.y() + 2); - - if (m_viewer->getKeyframeSelection() && - m_viewer->getKeyframeSelection()->isSelected(row, col)) { - // keyframe selected - keyPM = selectedKey; - } else { - // keyframe not selected - keyPM = key; - } - - if (m_keyHighlight == QPoint(row, col)) { - keyPM = keyPM.scaled(keyPM.width() + 10, keyPM.height() + 10); - target.setX(target.x() - 3); - target.setY(target.y() - 3); - } - p.drawPixmap(target, keyPM); } + + drawFrameMarker(p, QPoint(x, y), color, true, (col < 0), + (m_keyHighlight == QPoint(row, col))); } } diff --git a/toonz/sources/toonzlib/orientation.cpp b/toonz/sources/toonzlib/orientation.cpp index 0a9e18bf..370a27dd 100644 --- a/toonz/sources/toonzlib/orientation.cpp +++ b/toonz/sources/toonzlib/orientation.cpp @@ -16,8 +16,9 @@ const int PLAY_MARKER_SIZE = 10; const int PINNED_SIZE = 11; const int NAV_TAG_WIDTH = 7; const int NAV_TAG_HEIGHT = 13; -const int FRAME_MARKER_SIZE = 4; -const int FRAME_MARKER_SIZE_LARGE = FRAME_MARKER_SIZE + 2; +const int FRAME_MARKER_SIZE_SMALL = 4; +const int FRAME_MARKER_SIZE = FRAME_MARKER_SIZE_SMALL + 1; +const int FRAME_MARKER_SIZE_LARGE = FRAME_MARKER_SIZE_SMALL + 2; const int FOLDED_CELL_SIZE = 9; const int SHIFTTRACE_DOT_SIZE = 12; @@ -943,6 +944,13 @@ TopToBottomOrientation::TopToBottomOrientation() { corner.lineTo(QPointF(0, CELL_HEIGHT)); addPath(PredefinedPath::DRAG_HANDLE_CORNER, corner); + QPainterPath diamondSmall(QPointF(0, -FRAME_MARKER_SIZE_SMALL)); + diamondSmall.lineTo(FRAME_MARKER_SIZE_SMALL, 0); + diamondSmall.lineTo(0, FRAME_MARKER_SIZE_SMALL); + diamondSmall.lineTo(-FRAME_MARKER_SIZE_SMALL, 0); + diamondSmall.lineTo(0, -FRAME_MARKER_SIZE_SMALL); + addPath(PredefinedPath::FRAME_MARKER_DIAMOND_SMALL, diamondSmall); + QPainterPath diamond(QPointF(0, -FRAME_MARKER_SIZE)); diamond.lineTo(FRAME_MARKER_SIZE, 0); diamond.lineTo(0, FRAME_MARKER_SIZE); @@ -1407,6 +1415,13 @@ LeftToRightOrientation::LeftToRightOrientation() { corner.lineTo(QPointF(CELL_WIDTH, 0)); addPath(PredefinedPath::DRAG_HANDLE_CORNER, corner); + QPainterPath diamondSmall(QPointF(0, -FRAME_MARKER_SIZE_SMALL)); + diamondSmall.lineTo(FRAME_MARKER_SIZE_SMALL, 0); + diamondSmall.lineTo(0, FRAME_MARKER_SIZE_SMALL); + diamondSmall.lineTo(-FRAME_MARKER_SIZE_SMALL, 0); + diamondSmall.lineTo(0, -FRAME_MARKER_SIZE_SMALL); + addPath(PredefinedPath::FRAME_MARKER_DIAMOND_SMALL, diamondSmall); + QPainterPath diamond(QPointF(0, -FRAME_MARKER_SIZE)); diamond.lineTo(FRAME_MARKER_SIZE, 0); diamond.lineTo(0, FRAME_MARKER_SIZE);