 
   # ######################################
   @getter
-    windowSize:                -> @getMainCoordinate @getCurrentSize()
     isVertical:                -> @_childrenLayout == "column"
+
+    numChildrenOnScreen: ->
+      {isVertical, windowSize} = @
+      numChildrenOnScreen = 0
+
+      for child in @children when child.inFlow
+        if isVertical
+          pos = child.getCurrentLocationY false, point0
+          size = child.getCurrentSize().y
+        else
+          pos = child.getCurrentLocationX false, point0
+          size = child.getCurrentSize().x
+        numChildrenOnScreen++ if pos < windowSize && pos + size > 0
+
+      numChildrenOnScreen
+
   #   atEnd:                     -> @_atEnd
   #   atStart:                   -> @_atStart
   #   inMiddle:                  -> !@_atEnd && !@_atStart

      preprocess: (v) -> legalTrackingValues[v]
    tracking:           default: null

    scrollPosition:     default: 0

  defaultChildrenLayout:  "column"
  defaultChildArea:       "logicalArea"

  constructor: ->
    super
    @_maxScrollPosition = 0
    @_initGestureProps()

  postFlexLayout: (mainCoordinate, inFlowChildren, mainChildrenSize, mainElementSizeForChildren, mainChildrenAlignedOffset) ->
    {_focusedChild, _focusedChildAxis, _scrollPos, _scrollPosition, _tracking} = @getState true
    # log postFlexLayout: {mainChildrenSize, mainElementSizeForChildren}
    @_maxScrollPosition = max 0, mainChildrenSize - mainElementSizeForChildren

    offsetDelta = if mainChildrenSize <= mainElementSizeForChildren
      _scrollPosition
    else switch _tracking
      when "start", null then _scrollPosition - mainChildrenAlignedOffset
      when "end"         then _scrollPosition + mainElementSizeForChildren - mainChildrenSize - mainChildrenAlignedOffset
      when "child"
        _scrollPosition - if mainCoordinate == "x"
          _focusedChild.getCurrentLocationX true, point0

  animateToValidScrollPosition: ->
    pendingScrollPosition = @getScrollPosition true

    {childrenSize, windowSize} = @

    offscreenChildrenSize = childrenSize - windowSize

    pendingTracking = @getTracking true
    pendingTracking = null if childrenSize <= windowSize

    @scrollPosition = switch pendingTracking
      when "start"  then bound -offscreenChildrenSize, pendingScrollPosition, 0
      when "end"    then bound 0, pendingScrollPosition, offscreenChildrenSize
      when null     then 0
      when "child"  then pendingScrollPosition

