shithub: pt2-clone

Download patch

ref: 2070ac4176989b20390e87aa87f6e0695ca04461
parent: 13f78db51b1468212826bb3360a80773ffeb423a
author: Olav Sørensen <olav.sorensen@live.no>
date: Sat Jun 19 17:05:51 EDT 2021

Mouse wheel bugfix for sample editor toolboxes

--- a/src/pt2_mouse.c
+++ b/src/pt2_mouse.c
@@ -2079,7 +2079,8 @@
 
 void mouseWheelUpHandler(void)
 {
-	if (ui.editTextFlag || ui.askScreenShown || ui.clearScreenShown || editor.swapChannelFlag || ui.samplingBoxShown)
+	if (ui.editTextFlag || ui.askScreenShown || ui.clearScreenShown || editor.swapChannelFlag ||
+		ui.samplingBoxShown || ui.samplerVolBoxShown || ui.samplerFiltersBoxShown)
 		return;
 
 	if (mouse.y < 121)
@@ -2098,9 +2099,9 @@
 			modSetPos(song->currOrder - 1, DONT_SET_ROW);
 		}
 	}
-	else if (ui.samplerScreenShown)
+	else if (ui.samplerScreenShown) // lower part of screen
 	{
-		samplerZoomInMouseWheel(); // lower part of screen
+			samplerZoomInMouseWheel();
 	}
 	else if (!editor.songPlaying && song->currRow > 0)
 	{
@@ -2110,7 +2111,8 @@
 
 void mouseWheelDownHandler(void)
 {
-	if (ui.editTextFlag || ui.askScreenShown || ui.clearScreenShown || editor.swapChannelFlag || ui.samplingBoxShown)
+	if (ui.editTextFlag || ui.askScreenShown || ui.clearScreenShown || editor.swapChannelFlag ||
+		ui.samplingBoxShown || ui.samplerVolBoxShown || ui.samplerFiltersBoxShown)
 		return;
 
 	if (mouse.y < 121)
@@ -2129,9 +2131,10 @@
 			modSetPos(song->currOrder + 1, DONT_SET_ROW);
 		}
 	}
-	else if (ui.samplerScreenShown)
+	else if (ui.samplerScreenShown) // lower part of screen
 	{
-		samplerZoomOutMouseWheel(); // lower part of screen
+		if (!ui.samplerVolBoxShown && !ui.samplerFiltersBoxShown)
+			samplerZoomOutMouseWheel();
 	}
 	else if (!editor.songPlaying && song->currRow < MOD_ROWS)
 	{