translate method
Implementation
@override
void translate(Point p) {
var x1 = math.min(this.x1, this.x2);
var x2 = math.max(this.x1, this.x2);
var y1 = math.min(this.y1, this.y2);
var y2 = math.max(this.y1, this.y2);
var x = p.x.toInt();
var y = p.y.toInt();
x1 += x;
x2 += x;
y1 += y;
y2 += y;
this.x1 = x1;
this.x2 = x2;
this.y1 = y1;
this.y2 = y2;
}