Ticket #55160: spectrogram.cpp.diff

File spectrogram.cpp.diff, 2.1 KB (added by jmroot (Joshua Root), 6 years ago)

possible fix

  • src/scopes/audioscopes/spectrogram.cpp

    old new QImage Spectrogram::renderHUD(uint) 
    199199        if (m_aGrid->isChecked()) {
    200200            for (int frameNumber = 0; frameNumber < m_innerScopeRect.height(); frameNumber += minDistY) {
    201201                y = topDist + m_innerScopeRect.height()-1 - frameNumber;
    202                 hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(y - mouseY) < (int)textDistY && mouseY < m_innerScopeRect.height()
     202                hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs((int)(y - mouseY)) < (int)textDistY && mouseY < m_innerScopeRect.height()
    203203                        && mouseX < m_innerScopeRect.width() && mouseX >= 0;
    204204
    205205                davinci.drawLine(leftDist, y, leftDist + m_innerScopeRect.width()-1, y);
    QImage Spectrogram::renderHUD(uint) 
    241241                x = leftDist + (m_innerScopeRect.width()-1) * ((float)hz)/m_freqMax;
    242242
    243243                // Hide text if it would overlap with the text drawn at the mouse position
    244                 hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x-(leftDist + mouseX + 20)) < (int) minDistX + 16
     244                hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs((int)(x-(leftDist + mouseX + 20))) < (int) minDistX + 16
    245245                        && mouseX < m_innerScopeRect.width() && mouseX >= 0;
    246246
    247247                if (x <= rightBorder) {
    QImage Spectrogram::renderHUD(uint) 
    269269            }
    270270            // Draw the line at the very right (maximum frequency)
    271271            x = leftDist + m_innerScopeRect.width()-1;
    272             hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs(x-(leftDist + mouseX + 30)) < (int) minDistX
     272            hideText = m_aTrackMouse->isChecked() && m_mouseWithinWidget && abs((int)(x-(leftDist + mouseX + 30))) < (int) minDistX
    273273                    && mouseX < m_innerScopeRect.width() && mouseX >= 0;
    274274            davinci.drawLine(x, topDist, x, topDist + m_innerScopeRect.height()+6);
    275275            if (!hideText) {