mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
fix point markers ui bug (#5684)
This commit is contained in:
parent
b8af147a8d
commit
f65976cf4d
2 changed files with 17 additions and 10 deletions
|
|
@ -733,16 +733,8 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
|
|||
}
|
||||
}
|
||||
|
||||
// Add markers in chunks
|
||||
const CHUNK_SIZE = 10;
|
||||
for (let i = 0; i < timestampMarkers.length; i += CHUNK_SIZE) {
|
||||
const chunk = timestampMarkers.slice(i, i + CHUNK_SIZE);
|
||||
requestAnimationFrame(() => {
|
||||
chunk.forEach((m) => markers.addDotMarker(m));
|
||||
});
|
||||
}
|
||||
|
||||
requestAnimationFrame(() => {
|
||||
markers.addDotMarkers(timestampMarkers);
|
||||
markers.addRangeMarkers(rangeMarkers);
|
||||
});
|
||||
}, [getPlayer, scene, uiConfig]);
|
||||
|
|
|
|||
|
|
@ -100,6 +100,12 @@ class MarkersPlugin extends videojs.getPlugin("plugin") {
|
|||
if (seekBar) {
|
||||
seekBar.appendChild(markerSet.dot);
|
||||
}
|
||||
this.markers.push(marker);
|
||||
this.markerDivs.push(markerSet);
|
||||
}
|
||||
|
||||
addDotMarkers(markers: IMarker[]) {
|
||||
markers.forEach(this.addDotMarker, this);
|
||||
}
|
||||
|
||||
private renderRangeMarkers(markers: IMarker[], layer: number) {
|
||||
|
|
@ -255,7 +261,16 @@ class MarkersPlugin extends videojs.getPlugin("plugin") {
|
|||
}
|
||||
|
||||
clearMarkers() {
|
||||
this.removeMarkers([...this.markers]);
|
||||
for (const markerSet of this.markerDivs) {
|
||||
if (markerSet.dot?.hasAttribute("marker-tooltip-shown")) {
|
||||
this.hideMarkerTooltip();
|
||||
}
|
||||
|
||||
markerSet.dot?.remove();
|
||||
if (markerSet.range) markerSet.range.remove();
|
||||
}
|
||||
this.markers = [];
|
||||
this.markerDivs = [];
|
||||
}
|
||||
|
||||
// Implementing the findColors method
|
||||
|
|
|
|||
Loading…
Reference in a new issue