getBounds method

Rectangle<num> getBounds(
  1. DisplayObject targetSpace

Returns the bounds of this display object relative to the specified targetSpace.

This method may return ┬┤null┬┤ if this display objects has no relation to the targetSpace.


Rectangle<num> getBounds(DisplayObject targetSpace) {
  var rectangle = bounds;
  var matrix = getTransformationMatrix3D(targetSpace);
  if (matrix == null) return null;
  return matrix.transformRectangle(rectangle, rectangle);