Skip to content

Commit

Permalink
fix(match analyzer panel): fix drawing interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
zsliu98 committed Jan 1, 2025
1 parent c564e69 commit 98daf69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/panel/curve_panel/match_panel/match_analyzer_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@ namespace zlPanel {
analyzerRef.setDrawingDiffs(currentDrawIdx, currentDrawDB);
} else if (currentDrawIdx < preDrawIdx) {
float dB = currentDrawDB;
const float deltaDB = (preDrawDB - currentDrawDB) / static_cast<float>(preDrawIdx - currentDrawIdx - 1);
const float deltaDB = (preDrawDB - currentDrawDB) / static_cast<float>(preDrawIdx - currentDrawIdx);
for (size_t idx = currentDrawIdx; idx < preDrawIdx; ++idx) {
analyzerRef.setDrawingDiffs(idx, dB);
dB += deltaDB;
}
} else {
float dB = preDrawDB;
const float deltaDB = (currentDrawDB - preDrawDB) / static_cast<float>(currentDrawIdx - preDrawIdx - 1);
const float deltaDB = (currentDrawDB - preDrawDB) / static_cast<float>(currentDrawIdx - preDrawIdx);
for (size_t idx = preDrawIdx + 1; idx <= currentDrawIdx; ++idx) {
analyzerRef.setDrawingDiffs(idx, dB);
dB += deltaDB;
Expand Down

0 comments on commit 98daf69

Please sign in to comment.