mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 17:08:13 +00:00
Fix scrubber position when scrolled
This commit is contained in:
1 parent
c99f1d38a2
commit
dcd5a54350
2 files changed
+13
-5
No files matched your search
@@ -17,6 +17,8 @@ export const Scrubber = () => {
|
||||
if (displayTime * 4 * scale.value + 84 - timelineScrollX.value < 84) {
|
||||
return null;
|
||||
}
|
||||
|
||||
console.log(currentTime.value, displayTime, timelineScrollX.value);
|
||||
return (
|
||||
<div
|
||||
className="absolute flex cursor-ew-resize flex-col items-center text-brand-primary"
|
||||
@@ -24,8 +26,7 @@ export const Scrubber = () => {
|
||||
top: 8,
|
||||
left: displayTime * 4 * scale.value + 84 - timelineScrollX.value,
|
||||
}}
|
||||
onPointerDown={onPointerDown}
|
||||
>
|
||||
onPointerDown={onPointerDown}>
|
||||
<div>
|
||||
<FontAwesomeIcon icon={faSortDown} className="h-5 text-brand-primary" />
|
||||
</div>
|
||||
|
||||
@@ -26,7 +26,7 @@ export const useMouseEventsScrubber = () => {
|
||||
Queue.publish({
|
||||
queueName: QueueNames.TO_ENGINE,
|
||||
action: toEngineActions.UPDATE_TIME,
|
||||
data: { currentTime: Math.round(time) + timelineScrollX.value },
|
||||
data: { currentTime: Math.round(time) },
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -42,16 +42,23 @@ export const useMouseEventsScrubber = () => {
|
||||
return;
|
||||
}
|
||||
setTime((oldTime) => {
|
||||
console.log(
|
||||
oldTime,
|
||||
delta,
|
||||
delta + timelineScrollX.value,
|
||||
delta + timelineScrollX.value / 4 / scale.value,
|
||||
);
|
||||
if (oldTime !== delta) {
|
||||
Queue.publish({
|
||||
queueName: QueueNames.TO_ENGINE,
|
||||
action: toEngineActions.UPDATE_TIME,
|
||||
data: { currentTime: delta + timelineScrollX.value },
|
||||
data: {
|
||||
currentTime: delta,
|
||||
},
|
||||
});
|
||||
}
|
||||
return delta;
|
||||
});
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user