melhorando a leitura de projetos no mmpCreator
This commit is contained in:
1 parent
a3b8268f96
commit
ca2dd448c4
1 file changed
+5
-6
@@ -248,7 +248,7 @@ export function renderAudioEditor() {
|
||||
const menu = document.getElementById("ruler-context-menu");
|
||||
const currentPixelsPerSecond = getPixelsPerSecond();
|
||||
const rect = newRuler.getBoundingClientRect();
|
||||
const scrollLeft = newRuler.scrollLeft;
|
||||
const scrollLeft = scrollEl.scrollLeft;
|
||||
const clickX = e.clientX - rect.left;
|
||||
const absoluteX = clickX + scrollLeft;
|
||||
const clickTime = absoluteX / currentPixelsPerSecond;
|
||||
@@ -527,15 +527,15 @@ export function renderAudioEditor() {
|
||||
.forEach((g) => (g.style.width = `${widthPx}px`));
|
||||
}
|
||||
|
||||
newTrackContainer.addEventListener("scroll", () => {
|
||||
// Sync Scroll
|
||||
newTrackContainer.addEventListener("scroll", () => {
|
||||
const scrollPos = scrollEl.scrollLeft;
|
||||
|
||||
// sincroniza régua com o container
|
||||
const mainRuler = tracksParent.querySelector(".timeline-ruler");
|
||||
if (mainRuler && mainRuler.scrollLeft !== scrollPos) {
|
||||
mainRuler.scrollLeft = scrollPos; // funciona com overflow hidden (scroll programático)
|
||||
mainRuler.scrollLeft = scrollPos;
|
||||
}
|
||||
});
|
||||
|
||||
// expansão "infinita"
|
||||
const threshold = 300;
|
||||
@@ -545,16 +545,15 @@ export function renderAudioEditor() {
|
||||
if (rightEdge > currentWidth - threshold) {
|
||||
const newWidth = Math.ceil(currentWidth * 1.5);
|
||||
|
||||
// aplica widths
|
||||
applyTimelineWidth(newWidth);
|
||||
|
||||
// adiciona mais marcadores na régua (sem re-render geral)
|
||||
const rulerEl = tracksParent.querySelector(".timeline-ruler");
|
||||
appendRulerMarkers(rulerEl, currentWidth, newWidth, barWidthPx);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Event Listener Principal (mousedown)
|
||||
newTrackContainer.addEventListener("mousedown", (e) => {
|
||||
document.getElementById("timeline-context-menu").style.display = "none";
|
||||
|
||||
Reference in new issue
Block a user