diff --git a/src/util/roundtopixel.h b/src/util/roundtopixel.h index 635f6eb5325..7ab5c3f68c9 100644 --- a/src/util/roundtopixel.h +++ b/src/util/roundtopixel.h @@ -2,7 +2,7 @@ #include -inline auto makeRoundToPixel(float devicePixelRatio) { +inline auto createFunctionRoundToPixel(float devicePixelRatio) { return [devicePixelRatio](float pos) { return std::round(pos * devicePixelRatio) / devicePixelRatio; }; diff --git a/src/waveform/renderers/allshader/digitsrenderer.cpp b/src/waveform/renderers/allshader/digitsrenderer.cpp index ececeee35ee..cd7d9947e5d 100644 --- a/src/waveform/renderers/allshader/digitsrenderer.cpp +++ b/src/waveform/renderers/allshader/digitsrenderer.cpp @@ -131,7 +131,7 @@ void allshader::DigitsRenderer::updateTexture( const float y = maxTextHeight + space - 0.5f; - auto roundToPixel = makeRoundToPixel(devicePixelRatio); + auto roundToPixel = createFunctionRoundToPixel(devicePixelRatio); float totalTextWidth{}; std::array xs; diff --git a/src/waveform/renderers/allshader/waveformrendermark.cpp b/src/waveform/renderers/allshader/waveformrendermark.cpp index 876257b9a66..af995996ee0 100644 --- a/src/waveform/renderers/allshader/waveformrendermark.cpp +++ b/src/waveform/renderers/allshader/waveformrendermark.cpp @@ -203,7 +203,7 @@ void allshader::WaveformRenderMark::paintGL() { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - auto roundToPixel = makeRoundToPixel(devicePixelRatio); + auto roundToPixel = createFunctionRoundToPixel(devicePixelRatio); for (const auto& pMark : std::as_const(m_marks)) { pMark->setBreadth(slipActive ? m_waveformRenderer->getBreadth() / 2