Browse Source

Fix Sassy Scope freq tooltip

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.06
falkTX 3 years ago
parent
commit
7e1da35de7
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      plugins/Cardinal/src/sassy/sassy_scope.cpp

+ 4
- 4
plugins/Cardinal/src/sassy/sassy_scope.cpp View File

@@ -499,17 +499,17 @@ static void scope_freq(ScopeData* gScope, const float uiScale, int index)
ImVec2 mp = ImGui::GetMousePos();
mp.x -= p.x;
mp.y -= p.y;
if (mp.x > 0 && mp.x < grid_size * uiScale &&
mp.y > 0 && mp.y < grid_size * uiScale)
if (mp.x > 0 && mp.x < size * uiScale &&
mp.y > 0 && mp.y < size * uiScale)
{
ImGui::GetWindowDrawList()->AddLine(
ImVec2(p.x + mp.x, p.y),
ImVec2(p.x + mp.x, p.y + grid_size * uiScale),
0xff00ff00, 1 * uiScale);
ImGui::BeginTooltip();
int note = (int)(12 * log(32 * POW_2_3_4TH * (freqbins[(int)mp.x] / 440)) / log(2));
int note = (int)(12 * log(32 * POW_2_3_4TH * (freqbins[(int)(mp.x / uiScale)] / (sizef-1))) / log(2));
if (note < 0 || note > 127) note = -1;
ImGui::Text("%3.3fHz%s%s", freqbins[(int)mp.x], note==-1?"":"\n", note==-1?"":gNotestr[note]);
ImGui::Text("%3.3fHz%s%s", freqbins[(int)(mp.x / uiScale)], note==-1?"":"\n", note==-1?"":gNotestr[note]);
ImGui::EndTooltip();
}
}


Loading…
Cancel
Save