function applyMotionProps()

in packages/animation/src/animate.ts [36:52]


function applyMotionProps(object: RenderObject, props: MotionProps) {
  let isParentDirty = false
  if (props.x !== undefined) {
    object._offset = Point.fromXY(props.x, props.y!)
    isParentDirty = true
  }
  if (props.width !== undefined) {
    object._size = Size.fromWH(props.width, props.height!)
    isParentDirty = true
  }
  if (isParentDirty) {
    object.parent?.markPaintDirty()
  }
  if (props.rotation !== undefined && object instanceof RenderShape) {
    object.rotation = props.rotation
  }
}