Skip to content

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

C

Fix timeline key-scrolling (#2571)

manongjohn5aed7b8f8102
diff --git a/toonz/sources/toonz/xsheetviewer.cpp b/toonz/sources/toonz/xsheetviewer.cpp
index 333437148..0d7d9dbc8 100644
--- a/toonz/sources/toonz/xsheetviewer.cpp
+++ b/toonz/sources/toonz/xsheetviewer.cpp
@@ -1244,9 +1244,12 @@ void XsheetViewer::keyPressEvent(QKeyEvent *event) {
if (orientation()->isVerticalTimeline())
locals.scrollVertTo((frameCount + 1) * orientation()->cellHeight(),
visibleRect);
- else
- locals.scrollHorizTo((frameCount + 1) * orientation()->cellWidth(),
- visibleRect);
+ else {
+ int x = (((frameCount + 1) * orientation()->cellWidth()) *
+ getFrameZoomFactor()) /
+ 100;
+ locals.scrollHorizTo(x, visibleRect);
+ }
break;
}
break;
@@ -1367,8 +1370,11 @@ void XsheetViewer::scrollToColumn(int col) {
if (orientation()->isVerticalTimeline())
scrollToHorizontalRange(x0, x1);
- else
+ else {
+ if (colNext == col) x1 += m_orientation->cellHeight();
+
scrollToVerticalRange(x0, x1);
+ }
}
//-----------------------------------------------------------------------------