   maxChange
   absLt
   requestAnimationFrame
+  defineModule
 } = Foundation
 
 {point, Point, rect, Rectangle, matrix, Matrix, isPoint} = Atomic


      queueNextFrameUpdate()

module.exports = createWithPostCreate class PagingScrollElement extends AnimatorSupport Element

  constructor: ->
    @initAnimatorSupport()

    scrollPosition:
      default: 0
      postSetter: (position) ->
        unless @_activelyScrolling
          @queueEvent "scrollingActive"
          @_activelyScrolling = true

        @_lastScrollUpdatedAt = thisScrollUpdateWasAt = currentSecond()
        timeout 500, =>
          if @_lastScrollUpdatedAt == thisScrollUpdateWasAt
            @_activelyScrolling = false
            @queueEvent "scrollingIdle"

        # throw new Error if maxCount-- < 0
        # console.error "setScrollPosition #{position}"
        @onNextReady => @_updateAtStartAndAtEnd()
