@@ -171,14 +171,14 @@ void Textord::block_spacing_stats(
171
171
blob_box = box_next (&blob_it);
172
172
if (blob_box.width () < minwidth)
173
173
minwidth = blob_box.width ();
174
- gap_width = blob_box.left () - prev_blob_box.right ();
175
- if (!ignore_big_gap (row, row_length, gapmap,
176
- prev_blob_box.right (), blob_box.left ())) {
174
+ int16_t left = prev_blob_box.right ();
175
+ int16_t right = blob_box.left ();
176
+ gap_width = right - left;
177
+ if (!ignore_big_gap (row, row_length, gapmap, left, right)) {
177
178
all_gap_stats.add (gap_width, 1 );
178
179
179
- centre_to_centre = (blob_box.left () + blob_box.right () -
180
- (prev_blob_box.left () +
181
- prev_blob_box.right ())) / 2 ;
180
+ centre_to_centre = (right + blob_box.right () -
181
+ (prev_blob_box.left () + left)) / 2 ;
182
182
// DEBUG
183
183
centre_to_centre_stats.add (centre_to_centre, 1 );
184
184
// DEBUG
@@ -245,11 +245,11 @@ void Textord::block_spacing_stats(
245
245
blob_box = reduced_box_next (row, &blob_it);
246
246
else
247
247
blob_box = box_next (&blob_it);
248
- gap_width = blob_box.left () - prev_blob_box.right ();
248
+ int16_t left = prev_blob_box.right ();
249
+ int16_t right = blob_box.left ();
250
+ gap_width = right - left;
249
251
if ((gap_width > real_space_threshold) &&
250
- !ignore_big_gap (row, row_length, gapmap,
251
- prev_blob_box.right (),
252
- blob_box.left ())) {
252
+ !ignore_big_gap (row, row_length, gapmap, left, right)) {
253
253
/*
254
254
If tosp_use_cert_spaces is enabled, the estimate of the space gap is
255
255
restricted to obvious spaces - those wider than half the xht or those
@@ -350,11 +350,12 @@ void Textord::row_spacing_stats(
350
350
blob_box = reduced_box_next (row, &blob_it);
351
351
else
352
352
blob_box = box_next (&blob_it);
353
- gap_width = blob_box.left () - prev_blob_box.right ();
354
- if (ignore_big_gap (row, row_length, gapmap,
355
- prev_blob_box.right (), blob_box.left ()))
353
+ int16_t left = prev_blob_box.right ();
354
+ int16_t right = blob_box.left ();
355
+ gap_width = right - left;
356
+ if (ignore_big_gap (row, row_length, gapmap, left, right)) {
356
357
large_gap_count++;
357
- else {
358
+ } else {
358
359
if (gap_width >= real_space_threshold) {
359
360
if (!tosp_row_use_cert_spaces ||
360
361
(gap_width > tosp_fuzzy_space_factor2 * row->xheight ) ||
@@ -728,9 +729,10 @@ BOOL8 Textord::isolated_row_stats(TO_ROW *row,
728
729
blob_box = reduced_box_next (row, &blob_it);
729
730
else
730
731
blob_box = box_next (&blob_it);
731
- gap_width = blob_box.left () - prev_blob_box.right ();
732
- if (!ignore_big_gap (row, row_length, gapmap,
733
- prev_blob_box.right (), blob_box.left ()) &&
732
+ int16_t left = prev_blob_box.right ();
733
+ int16_t right = blob_box.left ();
734
+ gap_width = right - left;
735
+ if (!ignore_big_gap (row, row_length, gapmap, left, right) &&
734
736
(gap_width > crude_threshold_estimate)) {
735
737
if ((gap_width > tosp_fuzzy_space_factor2 * row->xheight ) ||
736
738
((gap_width > tosp_fuzzy_space_factor1 * row->xheight ) &&
0 commit comments