Skip to content

Commit

Permalink
missing headers, missing type cast
Browse files Browse the repository at this point in the history
  • Loading branch information
m0dB committed Oct 21, 2023
1 parent 7149759 commit 32203af
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/waveform/renderers/waveformmark.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "waveformmark.h"

#include <QOpenGLTexture>
#include <QPainterPath>
#include <QtDebug>

#include "skin/legacy/skincontext.h"
Expand Down Expand Up @@ -306,16 +307,22 @@ QImage WaveformMark::generateImage(float breadth, float devicePixelRatio) {
painter.setWorldMatrixEnabled(false);

// Draw marker lines
const float hcenter = markerGeometry.m_imageSize.width() / 2.f;
m_linePosition = hcenter;
const auto hcenter = markerGeometry.m_imageSize.width() / 2.f;
m_linePosition = static_cast<float>(hcenter);

// Draw the center line
painter.setPen(fillColor());
painter.drawLine(QLineF(hcenter, 0.f, hcenter, markerGeometry.m_imageSize.height()));

painter.setPen(borderColor());
painter.drawLine(QLineF(hcenter - 1.f, 0, hcenter - 1.f, markerGeometry.m_imageSize.height()));
painter.drawLine(QLineF(hcenter + 1.f, 0, hcenter + 1.f, markerGeometry.m_imageSize.height()));
painter.drawLine(QLineF(hcenter - 1.f,
0.f,
hcenter - 1.f,
markerGeometry.m_imageSize.height()));
painter.drawLine(QLineF(hcenter + 1.f,
0.f,
hcenter + 1.f,
markerGeometry.m_imageSize.height()));

if (label.length() != 0) {
painter.setPen(borderColor());
Expand Down

0 comments on commit 32203af

Please sign in to comment.