clarify Rect.Intersect doc

This commit is contained in:
faiface 2017-07-05 19:58:09 +02:00
parent 69d4a37e5e
commit da52aa25ec
1 changed files with 2 additions and 0 deletions

View File

@ -268,6 +268,8 @@ func (r Rect) Union(s Rect) Rect {
} }
// Intersect returns the maximal Rect which is covered by both r and s. Rects r and s must be normalized. // Intersect returns the maximal Rect which is covered by both r and s. Rects r and s must be normalized.
//
// If r and s don't overlap, this function returns R(0, 0, 0, 0).
func (r Rect) Intersect(s Rect) Rect { func (r Rect) Intersect(s Rect) Rect {
t := R( t := R(
math.Min(r.Max.X, s.Max.X), math.Min(r.Max.X, s.Max.X),