From c98391d3d7704f49437f60d9eaadeaf581cc8502 Mon Sep 17 00:00:00 2001 From: Jeff Breidenbach Date: Tue, 18 Sep 2018 08:09:11 +0200 Subject: [PATCH] fix #1192 bbox as the entire page --- src/textord/colpartitiongrid.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/textord/colpartitiongrid.cpp b/src/textord/colpartitiongrid.cpp index 3ed8152ad6..ed644b206d 100644 --- a/src/textord/colpartitiongrid.cpp +++ b/src/textord/colpartitiongrid.cpp @@ -719,6 +719,7 @@ void ColPartitionGrid::ExtractPartitionsAsBlocks(BLOCK_LIST* blocks, to_block->line_spacing = static_cast(box.height()); to_block->max_blob_size = static_cast(box.height() + 1); } + if (to_block->line_size == 0) to_block->line_size = 1; block_it.add_to_end(block); to_block_it.add_to_end(to_block); } else { @@ -1251,7 +1252,7 @@ void ColPartitionGrid::FindVPartitionPartners(bool to_the_left, const TBOX& box = part->bounding_box(); int left = part->median_left(); int right = part->median_right(); - int width = right - left; + int width = right >= left ? right - left : -1; int mid_x = (left + right) / 2; ColPartitionGridSearch hsearch(this); // Search left for neighbour to_the_left