Merge pull request #16 from jcushman/master

2x faster group_textboxes function.
pull/1/head
Yusuke Shinyama 2013-04-09 01:58:56 -07:00
commit 4faccff9c9
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()