Skip to content

Instantly share code, notes, and snippets.

@emad-elsaid
Created July 23, 2010 18:20
Show Gist options
  • Save emad-elsaid/487825 to your computer and use it in GitHub Desktop.
Save emad-elsaid/487825 to your computer and use it in GitHub Desktop.
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