Skip to content

Commit c98391d

Browse files
jbreiden2zdenop
authored andcommitted
fix #1192 bbox as the entire page
1 parent 59e42fc commit c98391d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/textord/colpartitiongrid.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,7 @@ void ColPartitionGrid::ExtractPartitionsAsBlocks(BLOCK_LIST* blocks,
719719
to_block->line_spacing = static_cast<float>(box.height());
720720
to_block->max_blob_size = static_cast<float>(box.height() + 1);
721721
}
722+
if (to_block->line_size == 0) to_block->line_size = 1;
722723
block_it.add_to_end(block);
723724
to_block_it.add_to_end(to_block);
724725
} else {
@@ -1251,7 +1252,7 @@ void ColPartitionGrid::FindVPartitionPartners(bool to_the_left,
12511252
const TBOX& box = part->bounding_box();
12521253
int left = part->median_left();
12531254
int right = part->median_right();
1254-
int width = right - left;
1255+
int width = right >= left ? right - left : -1;
12551256
int mid_x = (left + right) / 2;
12561257
ColPartitionGridSearch hsearch(this);
12571258
// Search left for neighbour to_the_left

0 commit comments

Comments
 (0)