feat: persist piano roll zoom level into project; fixed an issue in the horizontal auto-scrolling logic in piano roll window
This commit is contained in:
@@ -33,6 +33,7 @@ vi.mock('../../stores/projectStore', () => ({
|
||||
|
||||
import {
|
||||
createPendingModeSwitchRequest,
|
||||
getRegionStartScrollLeft,
|
||||
getRegionPlayheadRelation,
|
||||
getScrollLeftForViewportRequest,
|
||||
} from './PianoRoll';
|
||||
@@ -57,6 +58,13 @@ describe('PianoRoll viewport switch helpers', () => {
|
||||
expect(getRegionPlayheadRelation(25, 16, 24)).toBe('after');
|
||||
});
|
||||
|
||||
it('uses the zoomed beat width when scrolling to a different region in piano-roll view', () => {
|
||||
document.documentElement.style.setProperty('--region-grid-beat-width', '80px');
|
||||
document.documentElement.style.setProperty('--region-grid-bar-width', 'calc(var(--region-grid-beat-width) * var(--time-signature-numerator))');
|
||||
|
||||
expect(getRegionStartScrollLeft(16)).toBe(1280);
|
||||
});
|
||||
|
||||
it('centers an in-region playhead when switching to region-scope sheet view', () => {
|
||||
const request = createPendingModeSwitchRequest({
|
||||
playheadBeat: 20,
|
||||
|
||||
Reference in New Issue
Block a user