Make Page.lines work correctly for pages with no bottom margin.

This commit is contained in:
Andrey Golovizin 2014-08-26 20:31:05 +02:00
parent 7fab8328df
commit 8b95460f10

View file

@ -127,6 +127,8 @@ class Page(PageObject):
yield Line(self.image[line_start:i,:])
line_start = None
prev_line_end = i
if line_start is not None:
yield Line(self.image[line_start:,:])
def _merge_lines(self, lines, min_space=2, min_height=10):
prev_line = None
@ -150,7 +152,6 @@ class Page(PageObject):
yield prev_line
class Line(PageObject):
def __iter__(self):
return iter(self.glyphs)