---
scribo/scribo/core/stats.hh | 2 +-
scribo/scribo/text/merging.hh | 9 ++++++---
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/scribo/scribo/core/stats.hh b/scribo/scribo/core/stats.hh
index 095735c..ea00da9 100644
--- a/scribo/scribo/core/stats.hh
+++ b/scribo/scribo/core/stats.hh
@@ -269,7 +269,7 @@ private:
const T left_distance = data_[i] - data_[i - 1];
const T right_distance = data_[i + 1] - data_[i];
- if (not ((left_distance <= 2 || left_distance < right_distance)
+ if (not ((left_distance <= 1 || left_distance < right_distance)
&& left_distance <= std))
++cluster_index;
diff --git a/scribo/scribo/text/merging.hh b/scribo/scribo/text/merging.hh
index 453c6c3..c94f9f5 100644
--- a/scribo/scribo/text/merging.hh
+++ b/scribo/scribo/text/merging.hh
@@ -739,9 +739,12 @@ namespace scribo
// is horizontally close to the line's bbox and
// vertically aligned
// Obviously no separators between the two lines
- if (dx < l_ted_cw && dy < 0
- && not (l_info.holder().components().has_separators()
- && between_separators(l_info, mc_info)))
+ if ((l_info.card() <= 5 ||
+ (std::abs(l_info.baseline() - mc_info.baseline()) < 5
+ && std::abs(l_info.meanline() - mc_info.meanline()) < 5))
+ && dx < l_ted_cw && dy < 0
+ && not (l_info.holder().components().has_separators()
+ && between_separators(l_info, mc_info)))
l = do_union(lines, l, mc, parent);
// }
--
1.5.6.5