Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use std::min and std::max for min & max operations in makerow.cpp::most_overlapping_row() #4229

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/textord/makerow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2485,8 +2485,8 @@ OVERLAP_STATE most_overlapping_row( // find best row
row_it->forward();
test_row = row_it->data();
if (test_row->min_y() <= top && test_row->max_y() >= bottom) {
merge_top = test_row->max_y() > row->max_y() ? test_row->max_y() : row->max_y();
merge_bottom = test_row->min_y() < row->min_y() ? test_row->min_y() : row->min_y();
merge_top = std::max(test_row->max_y(),row->max_y());
merge_bottom = std::min(test_row->min_y(),row->min_y());
if (merge_top - merge_bottom <= rowsize) {
if (testing_blob && textord_debug_blob) {
tprintf("Merging rows at (%g,%g), (%g,%g)\n", row->min_y(), row->max_y(),
Expand Down
Loading