 
     if isFunction _scale
       {_parent} = state
-      parentCurrentSize = _parent.getState(pending)._currentSize
-      _scale = _scale parentCurrentSize, _currentSize
+      parentSize = withParentSize || _parent.getState(pending)._currentSize
+      # console.error "getElementToParentMatrixForXY - scale function"
+      # log _getElementToParentMatrixForXY:
+      #   parentSize: parentSize
+      #   currentSize: _currentSize
+      _scale = _scale parentSize, _currentSize
 
     _scale = point _scale
 

    @_elementChanged()
    p

  _setElementToParentMatrixFromLayout: (l) ->
    @_setElementToParentMatrixFromLayoutXY l.x, l.y


  _getElementToParentMatrixForXY: (pending, x, y, withScale) ->
    {
      _currentPadding, _currentSize, _axis, _scale, _angle, _elementToParentMatrix
    } = state = @getState pending

      .rotate _angle, true
      .translateXY x, y, true

  _setElementToParentMatrixFromLayout: (l, parentSize) ->
    @_setElementToParentMatrixFromLayoutXY l.x, l.y, parentSize

  _setElementToParentMatrixFromLayoutXY: (x, y, parentSize) ->
    return if @_locationLayoutDisabled

    # throw new Error unless isPoint parentSize
    e2p = @_getElementToParentMatrixForXY true, x, y, null, parentSize

    if !@_pendingState._elementToParentMatrix.eq e2p
      @_pendingState._elementToParentMatrix = e2p
