diff --git a/src/components/AnnotationsOverlayVideo.js b/src/components/AnnotationsOverlayVideo.js index 49309ab44e591f49d7aec37348a8c346e31f454b..7545824e9608b3bd1fa6bddcb421255d9c32ddbb 100755 --- a/src/components/AnnotationsOverlayVideo.js +++ b/src/components/AnnotationsOverlayVideo.js @@ -93,6 +93,12 @@ export class AnnotationsOverlayVideo extends Component { this.state = { showProgress: false, + canvasSize : { + canvasHeight:0, + canvasWidth:0, + containerHeight:0, + containerWidth:0, + } }; } @@ -494,9 +500,17 @@ export class AnnotationsOverlayVideo extends Component { /** */ canvasUpdateCallback() { return () => { + const { windowId } = this.props this.canvasOverlay.clear(); this.canvasOverlay.resize(); this.canvasOverlay.canvasUpdate(this.renderAnnotations.bind(this)); + this.setState({canvasSize: { + canvasHeight:this.canvasOverlay.canvasHeight, + canvasWidth:this.canvasOverlay.canvasWidth, + containerHeight:this.canvasOverlay.containerHeight, + containerWidth:this.canvasOverlay.containerWidth, + }}) + VideosReferences.setCanvasSizeInformation(windowId,this); }; } diff --git a/src/plugins/VideosReferences.js b/src/plugins/VideosReferences.js index db859ee35c7e3985d8570bcb7bf888c92381b512..395577b63c0fbb657705a4188aed19fc84dd3bd1 100644 --- a/src/plugins/VideosReferences.js +++ b/src/plugins/VideosReferences.js @@ -1,11 +1,23 @@ export const VideosReferences = { + myAnnotationOverlayVideo:{}, + canvasIIIF: {}, + refs: {}, + canvasSizeInformation : {}, /** */ get(windowId) { return this.refs[windowId]; }, - refs: {}, + getCanvaSizeInformation(){ + return this.canvasSizeInformation + }, /** */ set(windowId, ref) { this.refs[windowId] = ref; + this.canvasIIIF = ref.props + this.myAnnotationOverlayVideo = ref; + }, + + setCanvasSizeInformation(windowId, ref){ + this.canvasSizeInformation = ref.state.canvasSize; }, };