-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add keyboard shortcut for last annotation #950
base: master
Are you sure you want to change the base?
Changes from all commits
d87b45e
dfb8c50
c4f786c
e218c31
177509b
ef89f9d
6c195b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -673,6 +673,12 @@ export default { | |||||||
} | ||||||||
Messages.danger(`Invalid shape. ${shape} needs ${count} different points.`); | ||||||||
}, | ||||||||
selectLastAnnotation() { | ||||||||
let lastAnnotation = this.annotations.reduce((lastAnnotated, a) => a.id > lastAnnotated.id ? a : lastAnnotated, { id: 0 }); | ||||||||
let remainingAnnotations = this.annotations.filter(a => a.id != lastAnnotation.id); | ||||||||
lastAnnotation.selected = true; | ||||||||
remainingAnnotations.map(a => a.selected = false); | ||||||||
Comment on lines
+679
to
+680
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you tried this and it works? When an annotation is selected (e.g. in the sidebar) the tool should seek the video to the start of the annotation. In the videoContainer
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! When I tested it, I created multiple annotations in the same frame, which is why I didn't notice that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you leave the second parameter empty on purpose? Because this causes the last annotation only to be selected but not to seek the video, if another annotation was already selected on the timeline. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. I just wanted to avoid this.selectAnnotations([lastAnnotation], this.selectedAnnotations, lastAnnotation.startFrame); |
||||||||
} | ||||||||
}, | ||||||||
watch: { | ||||||||
'settings.playbackRate'(rate) { | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use
handleSelectAnnotation()
so there are not too many different places that handle selecting of annotations.