       scale: @getScale()
       naturalWidth: @props.naturalWidth
       naturalHeight: @props.naturalHeight
-      containerRect: @state.sizeRect
+      containerRect: @getSizeRect()
       getEventOffset: this.getEventOffset
       onChange: @props.onChange
       preferences: @props.preferences

      LastTaskComponent = tasks[lastTask.type]
      if LastTaskComponent.onLeaveAnnotation?
        LastTaskComponent.onLeaveAnnotation lastTask, oldAnnotation
    setTimeout => # Wait a tick for the annotation to load.
      @updateSize()

  updateSize: ->
    clientRect = @refs.sizeRect?.getBoundingClientRect() # Read only
    {left, right, top, bottom, width, height} = clientRect
    left += pageXOffset
    right += pageXOffset
    top += pageYOffset
    bottom += pageYOffset
    @setState sizeRect: {left, right, top, bottom, width, height}

  getScale: ->
    horizontal = @state.sizeRect?.width / @props.naturalWidth || 0
    vertical = @state.sizeRect?.height / @props.naturalHeight || 0
    {horizontal, vertical}

  getEventOffset: (e) ->
    scale = @getScale()
    x = (e.pageX - @state.sizeRect?.left) / scale.horizontal || 0
    y = (e.pageY - @state.sizeRect?.top) / scale.vertical || 0
    {x, y}

  render: ->

    onChange: Function.prototype

  getInitialState: ->
    alreadySeen: false
    showWarning: false

  componentDidMount: ->
    @setState alreadySeen: @props.subject.already_seen or seenThisSession.check @props.workflow, @props.subject

  componentWillReceiveProps: (nextProps) ->
    if nextProps.annotation isnt @props.annotation
