7_Canvas.t (gscan2pdf-2.13.1.tar.xz) | : | 7_Canvas.t (gscan2pdf-2.13.2.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 124 | skipping to change at line 124 | |||
</div> | </div> | |||
</div> | </div> | |||
</body> | </body> | |||
</html> | </html> | |||
EOS | EOS | |||
is( $canvas->hocr, $expected, 'updated hocr' ); | is( $canvas->hocr, $expected, 'updated hocr' ); | |||
$canvas->sort_by_position; | $canvas->sort_by_position; | |||
$bbox = $canvas->get_first_bbox; | $bbox = $canvas->get_first_bbox; | |||
is $bbox->get('text'), 'No', 'get_first_bbox position'; | is $bbox->get('text'), 'No', 'get_first_bbox position'; | |||
is $canvas->get_previous_bbox, undef, 'before get_first_bbox position'; | is $canvas->get_previous_bbox, undef, 'before get_first_bbox position'; | |||
$bbox = $canvas->get_next_bbox; | $bbox = $canvas->get_next_bbox; | |||
is $bbox->get('text'), 'quick', 'get_next_bbox position'; | is $bbox->get('text'), 'quick', 'get_next_bbox position'; | |||
$bbox = $canvas->get_previous_bbox; | $bbox = $canvas->get_previous_bbox; | |||
is $bbox->get('text'), 'No', 'get_previous_bbox position'; | is $bbox->get('text'), 'No', 'get_previous_bbox position'; | |||
$bbox = $canvas->get_last_bbox; | $bbox = $canvas->get_last_bbox; | |||
is $bbox->get('text'), 'foo', 'get_last_bbox position'; | is $bbox->get('text'), 'foo', 'get_last_bbox position'; | |||
is $canvas->get_next_bbox, undef, 'after get_last_bbox position'; | is $canvas->get_next_bbox, undef, 'after get_last_bbox position'; | |||
######################### | ######################### | |||
# v2.10.0 had a bug where adding a word box manually where there was an overlap | # v2.10.0 had a bug where adding a word box manually where there was an overlap | |||
# with another word box picked up the existing word box as the parent. | # with another word box picked up the existing word box as the parent. | |||
# A another bug prevented adding the text '0' | # A another bug prevented adding the text '0' | |||
$canvas->add_box( '0', { x => 356, y => 15, width => 74, height => 32 } ); | $canvas->add_box( '0', { x => 356, y => 15, width => 74, height => 32 } ); | |||
$expected = <<"EOS"; | $expected = <<"EOS"; | |||
skipping to change at line 181 | skipping to change at line 181 | |||
$canvas->sort_by_confidence; | $canvas->sort_by_confidence; | |||
$canvas->get_last_bbox->update_box( 'No', | $canvas->get_last_bbox->update_box( 'No', | |||
{ x => 2, y => 15, width => 75, height => 32 } ); | { x => 2, y => 15, width => 75, height => 32 } ); | |||
is $canvas->get_last_bbox->get('text'), 'No', | is $canvas->get_last_bbox->get('text'), 'No', | |||
"don't sort if confidence hasn't changed"; | "don't sort if confidence hasn't changed"; | |||
######################### | ######################### | |||
is_deeply( [ $canvas->get_bounds ], [ 0, 0, 70, 46 ], 'get_bounds' ); | is_deeply( [ $canvas->get_bounds ], [ 0, 0, 70, 46 ], 'get_bounds' ); | |||
is_deeply( $canvas->get_scale, 1, 'get_scale' ); | is_deeply( $canvas->get_scale, 1, 'get_scale' ); | |||
$canvas->_set_zoom_with_center( 2, 35, 26 ); | $canvas->_set_zoom_with_center( 2, 35, 26 ); | |||
is_deeply( [ $canvas->get_bounds ], [ 0, 0, 70, 46 ], 'get_bounds after zoom' ); | is_deeply( [ $canvas->get_bounds ], [ 0, 0, 70, 46 ], 'get_bounds after zoom' ); | |||
is_deeply( | is_deeply( | |||
[ $canvas->convert_from_pixels( 0, 0 ) ], | [ $canvas->convert_from_pixels( 0, 0 ) ], | |||
[ 0, 0 ], | [ 0, 0 ], | |||
'convert_from_pixels' | 'convert_from_pixels' | |||
); | ); | |||
my ( $width, $height ) = $page->get_size; | my ( $width, $height ) = $page->get_size; | |||
$canvas->set_bounds( -10, -10, $width + 10, $height + 10 ); | $canvas->set_bounds( -10, -10, $width + 10, $height + 10 ); | |||
is_deeply( | is_deeply( | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |