Skip to content

Commit 05f7b4f

Browse files
committed
fix playhead
1 parent d296580 commit 05f7b4f

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/renderer/components/keyframe-panel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export class KeyframePanel {
264264
const mins = Math.floor(seconds / 60);
265265
const secs = Math.floor(seconds % 60);
266266
const ms = Math.floor((seconds % 1) * 100);
267-
return `${mins}:${secs.toString().padStart(2, '0')}.${ms.toString().padStart(2, '0')}`;
267+
return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}.${ms.toString().padStart(2, '0')}`;
268268
}
269269
}
270270

src/renderer/components/timeline.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class Timeline {
3939
this.zoomRow = zoomRow;
4040

4141
// Initialize playhead at the start position (time = 0)
42-
const labelWidth = 100;
42+
const labelWidth = 80;
4343
this.playhead.style.left = `${labelWidth}px`;
4444

4545
this.setupEventListeners();
@@ -73,7 +73,7 @@ export class Timeline {
7373
// Calculate timeline width: duration in seconds * pixels per second
7474
const durationSeconds = this.duration / 1000;
7575
const timelineWidth = durationSeconds * this.pixelsPerSecond;
76-
const labelWidth = 100; // Width of the label column
76+
const labelWidth = 80; // Width of the label column
7777

7878
// Set width on ruler (ruler spans full width including label area)
7979
this.ruler.style.width = `${timelineWidth + labelWidth}px`;
@@ -103,7 +103,7 @@ export class Timeline {
103103

104104
updatePlayhead(time: number) {
105105
if (!this.duration) return;
106-
const labelWidth = 100; // Account for label width
106+
const labelWidth = 80; // Account for label width
107107
const position = (time * this.pixelsPerSecond) + labelWidth;
108108
this.playhead.style.left = `${position}px`;
109109
}
@@ -173,7 +173,7 @@ export class Timeline {
173173
const rect = this.container.getBoundingClientRect();
174174
const mouseX = e.clientX - rect.left;
175175
const scrollLeft = this.container.scrollLeft;
176-
const labelWidth = 100; // Account for label width
176+
const labelWidth = 80; // Account for label width
177177
let x = mouseX + scrollLeft - labelWidth; // Subtract label width to get position in content area
178178

179179
// Clamp x to the actual timeline width to prevent seeking beyond the video duration
@@ -243,7 +243,7 @@ export class Timeline {
243243
const durationSeconds = this.duration / 1000;
244244
const mins = Math.floor(durationSeconds / 60);
245245
const secs = Math.floor(durationSeconds % 60);
246-
section.textContent = `Video (${mins}:${secs.toString().padStart(2, '0')})`;
246+
section.textContent = `Video (${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')})`;
247247

248248
this.videoRow.appendChild(section);
249249
}
@@ -530,7 +530,7 @@ export class Timeline {
530530
const timelineWidth = this.getTimelineWidth();
531531
const interval = this.calculateRulerInterval();
532532
const marks: number[] = [];
533-
const labelWidth = 100; // Account for label width
533+
const labelWidth = 80; // Account for label width
534534

535535
for (let time = 0; time <= this.duration; time += interval) {
536536
marks.push(time);

0 commit comments

Comments
 (0)