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