Skip to content

Commit

Permalink
[previews] Annotation Data is inconsistent between players
Browse files Browse the repository at this point in the history
Annotation Data is inconsistent between Preview Player and Playlist Player (#1638):

* updates frame number on save to match player.js frame
* adds note on changed data depending where function is called, adds same offset to PreviewPlayer saved annotations to match player.js
* remove unneccessray console.log
  • Loading branch information
tetsuoanimation authored Dec 30, 2024
1 parent 183e10c commit 22ec32a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/mixins/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export const annotationMixin = {
addToAdditions(obj) {
this.markLastAnnotationTime()
const currentTime = this.getCurrentTime()
const currentFrame = this.getCurrentFrame()
const currentFrame = this.getCurrentFrame() // this is different, depending if it is called in PreviewPlayer or player.js
const additions = this.findAnnotation(this.additions, currentTime)
if (additions) {
additions.drawing.objects.push(obj.serialize())
Expand Down
4 changes: 2 additions & 2 deletions src/components/previews/PreviewPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1126,10 +1126,10 @@ export default {
getCurrentFrame() {
if (this.currentFrame) {
return this.currentFrame
return this.currentFrame + 1 //match offset in player.js
} else {
const time = roundToFrame(this.currentTimeRaw, this.fps) || 0
return Math.round(time / this.frameDuration)
return Math.round(time / this.frameDuration) + 1 //match offset in player.js
}
},
Expand Down

0 comments on commit 22ec32a

Please sign in to comment.