Silent timeline removed when hitting export

This commit is contained in:
2026-02-27 00:23:51 -08:00
parent c82ac37358
commit 96e99d2029
4 changed files with 42 additions and 17 deletions

View File

@@ -1,10 +1,5 @@
package transcode
// HandlerZoom holds the current scroll center for timeline zoom calculations.
type HandlerZoom struct {
Center float64 // center of the visible window in seconds
}
// ZoomResult is the result of a TimelineZoom calculation.
type ZoomResult struct {
Type string `json:"type"`
@@ -14,13 +9,13 @@ type ZoomResult struct {
}
// TimelineZoom computes the visible time window for the given zoomPercentage
// (1100, where 100 = full duration visible) centered on h.Center.
func (h *HandlerZoom) TimelineZoom(zoomPercentage, duration float64) *ZoomResult {
// (1100, where 100 = full duration visible) centered on zoomCenter.
func TimelineZoom(zoomCenter, zoomPercentage, duration float64) *ZoomResult {
visibleDuration := duration * (zoomPercentage / 100)
half := visibleDuration / 2
viewStart := h.Center - half
viewEnd := h.Center + half
viewStart := zoomCenter - half
viewEnd := zoomCenter + half
// Clamp to [0, duration], shifting the window rather than just truncating
// so the visible span stays the same size when near the edges.