mirror of
https://github.com/diffusionstudio/lottie.git
synced 2026-09-14 13:40:33 +08:00
fix: correct seek() off-by-one, clear selfWrites map, fix README dependency
This commit is contained in:
@@ -117,7 +117,7 @@ view.playAnimation()
|
||||
### Flutter
|
||||
```yaml
|
||||
dependencies:
|
||||
lottie: ^latest
|
||||
lottie: ^1.0.0
|
||||
```
|
||||
|
||||
```dart
|
||||
|
||||
@@ -298,7 +298,7 @@ export function CanvasProvider(props: { children: JSX.Element }) {
|
||||
const togglePlayback = () => setPlaying((v) => !v);
|
||||
|
||||
const seek = (frame: number) => {
|
||||
setCurrentFrame(Math.max(0, Math.min(frame, totalFrames())))
|
||||
setCurrentFrame(Math.max(0, Math.min(frame, totalFrames() - 1)))
|
||||
dirty = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -403,7 +403,10 @@ export function scenesPlugin(): Plugin {
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
if (selfWrites.get(file) === content) return; // echo of our own save — ignore
|
||||
if (selfWrites.get(file) === content) {
|
||||
selfWrites.delete(file);
|
||||
return; // echo of our own save — ignore
|
||||
}
|
||||
const rel = path.relative(projectsDir, file).split(path.sep).join("/");
|
||||
server.ws.send({ type: "custom", event: "scene:source", data: { lottie: `/projects/${rel}` } });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user