2x faster group_textboxes function.

pull/1/head
jcushman 2012-06-22 18:11:45 -03:00
parent c7709045e9
commit f77f196cd3
1 changed files with 2 additions and 2 deletions

View File

@ -609,8 +609,8 @@ class LTLayoutContainer(LTContainer):
group = LTTextGroupLRTB([obj1,obj2])
plane.remove(obj1)
plane.remove(obj2)
dists = [ (c,d,o1,o2) for (c,d,o1,o2) in dists
if o1 in plane and o2 in plane ]
# this line is optimized -- don't change without profiling
dists = [ n for n in dists if n[2] in plane._objs and n[3] in plane._objs ]
for other in plane:
dists.append((0, dist(group,other), group, other))
dists.sort()