Skip to content

Commit 6515340

Browse files
yoyofrkblaschke
authored andcommitted
fixed an issue with sep attribute mngt / per pixel
Signed-off-by: Kai Blaschke <kai.blaschke@kb-dev.net>
1 parent b78d6e7 commit 6515340

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libprojectM/MilkdropPreset/CustomWaveform.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,17 @@ void CustomWaveform::Draw(const PerFrameContext& presetPerFrameContext)
7676

7777
int const maxSampleCount{m_spectrum ? Audio::SpectrumSamples : Audio::WaveformSamples};
7878

79+
int sampleCount = std::min(maxSampleCount, static_cast<int>(*m_perFrameContext.samples));
80+
sampleCount -= m_sep;
81+
7982
// Initialize and execute per-frame code
8083
LoadPerFrameEvaluationVariables(presetPerFrameContext);
8184
m_perFrameContext.ExecutePerFrameCode();
8285

8386
// Copy Q and T vars to per-point context
8487
InitPerPointEvaluationVariables();
8588

86-
int sampleCount = std::min(maxSampleCount, static_cast<int>(*m_perFrameContext.samples));
87-
sampleCount -= m_sep;
89+
sampleCount = std::min(maxSampleCount, static_cast<int>(*m_perFrameContext.samples));
8890

8991
// If there aren't enough samples to draw a single line or dot, skip drawing the waveform.
9092
if ((m_useDots && sampleCount < 1) || sampleCount < 2)

0 commit comments

Comments
 (0)