     onChange: Function.prototype
 
   getInitialState: ->
-    sizeRect: null
     alreadySeen: false
     showWarning: false
 
   componentDidMount: ->
-    addEventListener 'resize', @updateSize
-    @updateSize()
     @setState alreadySeen: @props.subject.already_seen or seenThisSession.check @props.workflow, @props.subject
-
-  componentDidUpdate: (prevProps, prevState)->
-    # If size of the frame image or viewBoxDimensions has changed, update our sizing information (used for scaling/translating annotations)
-    if @props.naturalWidth isnt prevProps.naturalWidth or @props.naturalHeight isnt prevProps.naturalHeight or @props.viewBoxDimensions isnt prevProps.viewBoxDimensions
-      setTimeout =>
-        @updateSize()
-
-  componentWillUnmount: ->
-    removeEventListener 'resize', @updateSize
 
   componentWillReceiveProps: (nextProps) ->
     if nextProps.annotation isnt @props.annotation

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

      LastTaskComponent = tasks[lastTask.type]
      if LastTaskComponent.onLeaveAnnotation?
        LastTaskComponent.onLeaveAnnotation lastTask, oldAnnotation
  
  getSizeRect: ->
    clientRect = @refs.sizeRect?.getBoundingClientRect() # Read only
    return null unless clientRect?
    {left, right, top, bottom, width, height} = clientRect
    left += pageXOffset
    right += pageXOffset
    top += pageYOffset
    bottom += pageYOffset
    {left, right, top, bottom, width, height}

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

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

  render: ->
