containsPoint 方法

bool containsPoint(
  1. Point<num> another
)

判断 another 是否在 this 的内部或边上。

实现

bool containsPoint(Point<num> another) {
  return another.x >= left &&
      another.x <= left + width &&
      another.y >= top &&
      another.y <= top + height;
}