shithub: ft²

Download patch

ref: 178bdf8be18b8056ba13e0b281246cfbaca666ca
parent: c76bf4cb46d92930413d34ee8b47dc2d0c2b856c
author: Olav Sørensen <olav.sorensen@live.no>
date: Sun Dec 29 17:48:33 EST 2024

Scroll speed change for waveform in sample editor

--- a/src/ft2_sample_ed.c
+++ b/src/ft2_sample_ed.c
@@ -1539,7 +1539,7 @@
 
 void scrollSampleDataLeft(void)
 {
-	int32_t scrollAmount, sampleLen;
+	int32_t sampleLen;
 
 	if (instr[editor.curInstr] == NULL)
 		sampleLen = 0;
@@ -1549,11 +1549,7 @@
 	if (smpEd_ViewSize == 0 || smpEd_ViewSize == sampleLen)
 		return;
 
-	if (mouse.rightButtonPressed)
-		scrollAmount = smpEd_ViewSize / SCALE_VBLANK_DELTA(16);
-	else
-		scrollAmount = smpEd_ViewSize / SCALE_VBLANK_DELTA(32);
-
+	int32_t scrollAmount = (uint32_t)smpEd_ViewSize / 32;
 	if (scrollAmount < 1)
 		scrollAmount = 1;
 
@@ -1566,7 +1562,7 @@
 
 void scrollSampleDataRight(void)
 {
-	int32_t scrollAmount, sampleLen;
+	int32_t sampleLen;
 
 	if (instr[editor.curInstr] == NULL)
 		sampleLen = 0;
@@ -1576,11 +1572,7 @@
 	if (smpEd_ViewSize == 0 || smpEd_ViewSize == sampleLen)
 		return;
 
-	if (mouse.rightButtonPressed)
-		scrollAmount = smpEd_ViewSize / SCALE_VBLANK_DELTA(16);
-	else
-		scrollAmount = smpEd_ViewSize / SCALE_VBLANK_DELTA(32);
-
+	int32_t scrollAmount = (uint32_t)smpEd_ViewSize / 32;
 	if (scrollAmount < 1)
 		scrollAmount = 1;
 
--