From 9f897e4c37757c26fcc5e3e7aa7a760f4eba19b1 Mon Sep 17 00:00:00 2001 From: Frank Rousseau Date: Wed, 22 Jan 2025 21:44:42 +0100 Subject: [PATCH 1/3] [previews] Fix wrong video positioning Second attempt to fix panzoom glitch --- src/components/previews/VideoViewer.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/previews/VideoViewer.vue b/src/components/previews/VideoViewer.vue index 0c72b7b6b..1028f6b4e 100644 --- a/src/components/previews/VideoViewer.vue +++ b/src/components/previews/VideoViewer.vue @@ -522,6 +522,9 @@ export default { this.pause() this.$nextTick(() => { this.resetPanZoom() + setTimeout(() => { + this.resetPanZoom() + }, 100) }) }, From 0ca8c3b597368a1f39bd69445ac68730d8eb4c1f Mon Sep 17 00:00:00 2001 From: Frank Rousseau Date: Wed, 22 Jan 2025 21:45:26 +0100 Subject: [PATCH 2/3] [previews] Reload annotations when progress is changed --- src/components/previews/PreviewPlayer.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/previews/PreviewPlayer.vue b/src/components/previews/PreviewPlayer.vue index 78287cceb..c18636a46 100644 --- a/src/components/previews/PreviewPlayer.vue +++ b/src/components/previews/PreviewPlayer.vue @@ -1230,6 +1230,7 @@ export default { }, onProgressChanged(frame) { + this.reloadAnnotations() if (this.currentFrame !== frame) { this.clearCanvas() this.setCurrentFrame(frame) From 75f07f6626f2bf4929b6edf46b6dbca1e3c2c8c7 Mon Sep 17 00:00:00 2001 From: Frank Rousseau Date: Wed, 22 Jan 2025 21:47:45 +0100 Subject: [PATCH 3/3] [previews] Fix annotation group copy pasting --- src/components/mixins/annotation.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/components/mixins/annotation.js b/src/components/mixins/annotation.js index 3307546d1..9fbb729d6 100644 --- a/src/components/mixins/annotation.js +++ b/src/components/mixins/annotation.js @@ -1306,9 +1306,17 @@ export const annotationMixin = { copyAnnotations() { if (!this.fabricCanvas) return const activeObject = this.fabricCanvas.getActiveObject() - if (activeObject) { - const obj = Object.create(activeObject) - clipboard.copyAnnotations(obj) + if (!activeObject) return + if (activeObject._objects) { + clipboard.copyAnnotations({ + mainObject: activeObject, + subObjects: [...activeObject._objects] + }) + } else { + clipboard.copyAnnotations({ + mainObject: Object.create(activeObject), + subObjects: [] + }) } return activeObject }, @@ -1319,17 +1327,17 @@ export const annotationMixin = { pasteAnnotations() { if (!this.fabricCanvas) return this.fabricCanvas.discardActiveObject() - const clonedObj = clipboard.pasteAnnotations() - if (clonedObj._objects) { - clonedObj._objects.forEach(obj => { - obj = this.applyGroupChanges(clonedObj, obj) + const { mainObject, subObjects } = clipboard.pasteAnnotations() + if (subObjects.length > 0) { + subObjects.forEach(obj => { + obj = this.applyGroupChanges(mainObject, obj) obj.group = null this.addObject(obj) }) this.fabricCanvas.requestRenderAll() } else { - this.addObject(clonedObj) - this.fabricCanvas.setActiveObject(clonedObj) + this.addObject(mainObject) + this.fabricCanvas.setActiveObject(mainObject) this.fabricCanvas.requestRenderAll() } },