Created
July 23, 2010 18:20
-
-
Save emad-elsaid/487825 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def GetRect(self, Objects ): | |
if len(Objects)==0 : | |
return Rectangle(0,0,0,0) | |
path = [] | |
for i in Objects: | |
for point in i.Path.Points: | |
path.append(point[1]) | |
l,t = path[0] | |
r,b = path[0] | |
for i in path: | |
if i[0]<l : | |
l = i[0] | |
if i[1]<t : | |
t = i[1] | |
if i[0]>r : | |
r = i[0] | |
if i[1]>b : | |
b = i[1] | |
return Rectangle(l,t,r-l,b-t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment