From d787871735dec235d7f7abc594756e126a8fccf2 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sun, 3 May 2026 11:36:25 +0200 Subject: [PATCH] fix: auto-pan timeline to follow playback position when zoomed in Revert span opacity back to 35 (was fine). The actual issue was the play position line disappearing when scrolled out of the zoomed view. Now set_play_position auto-pans the view window to keep the playback marker visible with a 10% margin. Co-Authored-By: Claude Opus 4.6 --- main.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 4eafc7e..4e29e6c 100755 --- a/main.py +++ b/main.py @@ -1814,6 +1814,15 @@ class TimelineWidget(QWidget): if self._locked and self._play_pos is not None and self._seek_timer.isActive(): return self._play_pos = t + if t is not None and self._view_span > 0: + view_end = self._view_start + self._view_span + margin = self._view_span * 0.1 + if t > view_end - margin: + self._view_start = t - self._view_span + margin + self._clamp_view() + elif t < self._view_start + margin: + self._view_start = t - margin + self._clamp_view() self.update() def set_crop_keyframes(self, kfs: list[tuple[float, float, str | None, bool, bool]]) -> None: @@ -2017,7 +2026,7 @@ class TimelineWidget(QWidget): mx1 = int(self._time_to_x(t)) mx2 = int(self._time_to_x(min(t + span, self._duration))) if mx2 > mx1 and mx2 > 0 and mx1 < w: - p.fillRect(mx1, rh, mx2 - mx1, th, QColor(200, 160, 60, 70)) + p.fillRect(mx1, rh, mx2 - mx1, th, QColor(200, 160, 60, 35)) # ── export markers ──────────────────────────────────────────── p.setFont(self._marker_font)