setByRect method

void setByRect(
  1. Rect rect
)

Implementation

void setByRect(Rect rect) {
  x = rect.left + anchor.relativePosition.dx * rect.width;
  y = rect.top + anchor.relativePosition.dy * rect.height;
  width = rect.width;
  height = rect.height;
}