diff --git a/src/drivers/win/taseditor/greenzone.cpp b/src/drivers/win/taseditor/greenzone.cpp index 55e915ce..63e103d4 100644 --- a/src/drivers/win/taseditor/greenzone.cpp +++ b/src/drivers/win/taseditor/greenzone.cpp @@ -403,11 +403,12 @@ void GREENZONE::InvalidateAndCheck(int after) if (currFrameCounter >= greenZoneCount) { // remember the lost position - if (playback.lost_position_frame < currFrameCounter + 1) + if ((playback.lost_position_frame < currFrameCounter + 1) || (playback.lost_position_frame > currFrameCounter + 1 && !playback.lost_position_must_be_fixed)) { if (playback.lost_position_frame) piano_roll.RedrawRow(playback.lost_position_frame - 1); playback.lost_position_frame = currFrameCounter + 1; + playback.lost_position_must_be_fixed = true; } // auto-restore position if needed if (taseditor_config.restore_position) diff --git a/src/drivers/win/taseditor/playback.cpp b/src/drivers/win/taseditor/playback.cpp index 01cc59dd..76f6ad26 100644 --- a/src/drivers/win/taseditor/playback.cpp +++ b/src/drivers/win/taseditor/playback.cpp @@ -72,7 +72,7 @@ void PLAYBACK::reset() shown_marker = 0; lastCursor = currFrameCounter; lost_position_frame = pause_frame = old_pauseframe = 0; - old_show_pauseframe = show_pauseframe = false; + lost_position_must_be_fixed = old_show_pauseframe = show_pauseframe = false; old_rewind_button_state = rewind_button_state = false; old_forward_button_state = forward_button_state = false; old_rewind_full_button_state = rewind_full_button_state = false; @@ -228,6 +228,10 @@ void PLAYBACK::update() RedrawMarker(); must_find_current_marker = false; } + + if (!emu_paused) + // when emulating, lost_position_frame becomes unfixed + lost_position_must_be_fixed = false; } void PLAYBACK::updateProgressbar() @@ -486,15 +490,7 @@ void PLAYBACK::SetProgressbar(int a, int b) void PLAYBACK::CancelSeeking() { if (pause_frame) - { - // also invalidate lost_position_frame if user cancelled seeking to it - if (lost_position_frame == pause_frame) - { - piano_roll.RedrawRow(lost_position_frame - 1); - lost_position_frame = 0; - } SeekingStop(); - } } // ------------------------------------------------------------------------- LRESULT APIENTRY UpperMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) diff --git a/src/drivers/win/taseditor/playback.h b/src/drivers/win/taseditor/playback.h index 1b810d48..2175de45 100644 --- a/src/drivers/win/taseditor/playback.h +++ b/src/drivers/win/taseditor/playback.h @@ -45,6 +45,7 @@ public: int lastCursor; // but for currentCursor we use external variable currFrameCounter int lost_position_frame; + bool lost_position_must_be_fixed; // when Greenzone invalidates several times, but the end of current segment must remain the same int pause_frame; bool must_find_current_marker; int shown_marker;