Gui editors: Use float for zoom precision (#6008)

This fixes build errors with casts.
This commit is contained in:
David CARLIER
2021-05-15 16:17:40 +01:00
committed by GitHub
parent 4589004e6c
commit e9f264e37f
8 changed files with 15 additions and 15 deletions

View File

@@ -71,7 +71,7 @@ QPixmap * AutomationEditor::s_toolMove = nullptr;
QPixmap * AutomationEditor::s_toolYFlip = nullptr;
QPixmap * AutomationEditor::s_toolXFlip = nullptr;
const QVector<double> AutomationEditor::m_zoomXLevels =
const QVector<float> AutomationEditor::m_zoomXLevels =
{ 0.125f, 0.25f, 0.5f, 1.0f, 2.0f, 4.0f, 8.0f };

View File

@@ -140,10 +140,10 @@ PianoRoll::PianoRollKeyTypes PianoRoll::prKeyOrder[] =
const int DEFAULT_PR_PPB = DEFAULT_CELL_WIDTH * DefaultStepsPerBar;
const QVector<double> PianoRoll::m_zoomLevels =
const QVector<float> PianoRoll::m_zoomLevels =
{0.125f, 0.25f, 0.5f, 1.0f, 1.5f, 2.0f, 4.0f, 8.0f};
const QVector<double> PianoRoll::m_zoomYLevels =
const QVector<float> PianoRoll::m_zoomYLevels =
{0.25f, 0.5f, 1.0f, 1.5f, 2.0f, 2.5f, 3.0f, 4.0f};

View File

@@ -54,7 +54,7 @@
#include "ToolTip.h"
#include "Track.h"
const QVector<double> SongEditor::m_zoomLevels =
const QVector<float> SongEditor::m_zoomLevels =
{ 0.125f, 0.25f, 0.5f, 1.0f, 2.0f, 4.0f, 8.0f, 16.0f };
SongEditor::SongEditor( Song * song ) :
@@ -99,8 +99,8 @@ SongEditor::SongEditor( Song * song ) :
connect( m_song, SIGNAL( playbackStateChanged() ),
m_positionLine, SLOT( update() ) );
connect( this, SIGNAL( zoomingValueChanged( double ) ),
m_positionLine, SLOT( zoomChange( double ) ) );
connect( this, SIGNAL( zoomingValueChanged( float ) ),
m_positionLine, SLOT( zoomChange( float ) ) );
// add some essential widgets to global tool-bar

View File

@@ -87,7 +87,7 @@ void PositionLine::paintEvent(QPaintEvent* pe)
// NOTE: the move() implementation fixes a bug where the position line would appear
// in an unexpected location when positioned at the start of the track
void PositionLine::zoomChange(double zoom)
void PositionLine::zoomChange(float zoom)
{
int playHeadPos = x() + width() - 1;
@@ -95,4 +95,4 @@ void PositionLine::zoomChange(double zoom)
move(playHeadPos - width() + 1, y());
update();
}
}