fix oscref_channel not taking into account hidden channels

i love when children annoy me then i get ignored for the rest of the day
This commit is contained in:
Eknous-P 2025-11-13 00:32:29 +04:00
parent c681ac507e
commit b5fc6ff39d
2 changed files with 5 additions and 5 deletions

View file

@ -56,7 +56,7 @@ static void _drawOsc(const ImDrawList* drawList, const ImDrawCmd* cmd) {
}
}
float FurnaceGUI::computeGradPos(int type, int chan) {
float FurnaceGUI::computeGradPos(int type, int chan, int totalChans) {
switch (type) {
case GUI_OSCREF_NONE:
return 0.0f;
@ -74,7 +74,7 @@ float FurnaceGUI::computeGradPos(int type, int chan) {
return chanOscVol[chan];
break;
case GUI_OSCREF_CHANNEL:
return (float)chan/(float)(e->getTotalChannelCount()-1);
return (float)chan/(float)(totalChans-1);
break;
case GUI_OSCREF_BRIGHT:
return chanOscBright[chan];
@ -798,8 +798,8 @@ void FurnaceGUI::drawChanOsc() {
}
ImU32 color=ImGui::GetColorU32(chanOscUseChanColor?channelColor(oscChans[i]):chanOscColor);
if (chanOscUseGrad) {
float xVal=computeGradPos(chanOscColorX,ch);
float yVal=computeGradPos(chanOscColorY,ch);
float xVal=computeGradPos(chanOscColorX,ch,oscBufs.size());
float yVal=computeGradPos(chanOscColorY,ch,oscBufs.size());
xVal=CLAMP(xVal,0.0f,1.0f);
yVal=CLAMP(yVal,0.0f,1.0f);

View file

@ -3102,7 +3102,7 @@ class FurnaceGUI {
bool importConfig(String path);
bool exportConfig(String path);
float computeGradPos(int type, int chan);
float computeGradPos(int type, int chan, int totalChans);
void resetColors();
void resetKeybinds();