Bug fixes for Qt TAS editor playback cursor following.
This commit is contained in:
parent
cd1d8f643e
commit
fd208cb8f8
|
@ -3591,6 +3591,7 @@ QPianoRoll::QPianoRoll(QWidget *parent)
|
||||||
|
|
||||||
lineOffset = 0;
|
lineOffset = 0;
|
||||||
maxLineOffset = 0;
|
maxLineOffset = 0;
|
||||||
|
playbackCursorPos = 0;
|
||||||
dragMode = DRAG_MODE_NONE;
|
dragMode = DRAG_MODE_NONE;
|
||||||
dragSelectionStartingFrame = 0;
|
dragSelectionStartingFrame = 0;
|
||||||
dragSelectionEndingFrame = 0;
|
dragSelectionEndingFrame = 0;
|
||||||
|
@ -5330,7 +5331,40 @@ void QPianoRoll::paintEvent(QPaintEvent *event)
|
||||||
vbar->show();
|
vbar->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
lineOffset = maxLineOffset - vbar->value();
|
if ( taseditorConfig->followPlaybackCursor )
|
||||||
|
{
|
||||||
|
lineOffset = maxLineOffset - vbar->value();
|
||||||
|
|
||||||
|
if ( playbackCursorPos != currFrameCounter )
|
||||||
|
{
|
||||||
|
int lineOffsetLowerLim, lineOffsetUpperLim;
|
||||||
|
|
||||||
|
playbackCursorPos = currFrameCounter;
|
||||||
|
|
||||||
|
lineOffsetLowerLim = playbackCursorPos - nrow + 5;
|
||||||
|
lineOffsetUpperLim = playbackCursorPos + nrow;
|
||||||
|
|
||||||
|
//if ( !lineIsVisible( playbackCursorPos ) )
|
||||||
|
if ( lineOffset < lineOffsetLowerLim )
|
||||||
|
{
|
||||||
|
lineOffset = lineOffsetLowerLim;
|
||||||
|
vbar->setValue( maxLineOffset - lineOffset );
|
||||||
|
}
|
||||||
|
else if ( lineOffset > lineOffsetUpperLim )
|
||||||
|
{
|
||||||
|
lineOffset = lineOffsetUpperLim - nrow;
|
||||||
|
if ( lineOffset < 0 )
|
||||||
|
{
|
||||||
|
lineOffset = 0;
|
||||||
|
}
|
||||||
|
vbar->setValue( maxLineOffset - lineOffset );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vbar->setValue( maxLineOffset - lineOffset );
|
||||||
|
}
|
||||||
|
|
||||||
if ( lineOffset < 0 )
|
if ( lineOffset < 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -236,6 +236,8 @@ class QPianoRoll : public QWidget
|
||||||
int mouse_x;
|
int mouse_x;
|
||||||
int mouse_y;
|
int mouse_y;
|
||||||
|
|
||||||
|
int playbackCursorPos;
|
||||||
|
|
||||||
bool useDarkTheme;
|
bool useDarkTheme;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
Loading…
Reference in New Issue