Kaydet (Commit) 124eb942 authored tarafından Guido van Rossum's avatar Guido van Rossum

Fix bug in rect.intersect(): empty rects beyond the first were

ignored instead of making the outcome empty...
üst e1f069ec
...@@ -29,7 +29,8 @@ def intersect(list): ...@@ -29,7 +29,8 @@ def intersect(list):
if is_empty(list[0]): return empty if is_empty(list[0]): return empty
(left, top), (right, bottom) = list[0] (left, top), (right, bottom) = list[0]
for rect in list[1:]: for rect in list[1:]:
if not is_empty(rect): if is_empty(rect):
return empty
(l, t), (r, b) = rect (l, t), (r, b) = rect
if left < l: left = l if left < l: left = l
if top < t: top = t if top < t: top = t
......
...@@ -29,7 +29,8 @@ def intersect(list): ...@@ -29,7 +29,8 @@ def intersect(list):
if is_empty(list[0]): return empty if is_empty(list[0]): return empty
(left, top), (right, bottom) = list[0] (left, top), (right, bottom) = list[0]
for rect in list[1:]: for rect in list[1:]:
if not is_empty(rect): if is_empty(rect):
return empty
(l, t), (r, b) = rect (l, t), (r, b) = rect
if left < l: left = l if left < l: left = l
if top < t: top = t if top < t: top = t
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment