func (r Rectangle) Canon() Rectangle {
	if r.Max.X < r.Min.X {
		r.Min.X, r.Max.X = r.Max.X, r.Min.X
	}
	if r.Max.Y < r.Min.Y {
		r.Min.Y, r.Max.Y = r.Max.Y, r.Min.Y
	}
	return r
}
func (r Rectangle) Canon() Rectangle {
	if r.Max.X < r.Min.X {
		r.Min.X, r.Max.X = r.Max.X, r.Min.X
	}
	if r.Max.Y < r.Min.Y {
		r.Min.Y, r.Max.Y = r.Max.Y, r.Min.Y
	}
	return r
}
func ( r Rectangle ) Canon ( ) Rectangle { if r . Max . X < r . Min . X { r . Min . X , r . Max . X = r . Max . X , r . Min . X } if r . Max . Y < r . Min . Y { r . Min . Y , r . Max . Y = r . Max . Y , r . Min . Y } return r }
// Canon returns the canonical version of r. The returned rectangle has minimum
// and maximum coordinates swapped if necessary so that it is well-formed.
Canon returns the canonical version of r . The returned rectangle has minimum and maximum coordinates swapped if necessary so that it is well - formed .