@@ -444,4 +444,44 @@ mod tests {
444444 assert ! ( path. outline_fixed_scale( & style, f64 :: NAN ) . is_err( ) ) ;
445445 assert ! ( path. outline_fixed_scale( & style, f64 :: INFINITY ) . is_err( ) ) ;
446446 }
447+
448+ #[ test]
449+ fn test_zero_length_segment_0 ( ) {
450+ let path = [
451+ [ 2681.39599938213 , 5892784.488998892 ] ,
452+ [ 5419.06964821636 , 5891947.742386343 ] ,
453+ [ 5419.1446127397 , 5891949.316633703 ] ,
454+ [ 5422.8669123155 , 5892027.484991552 ] ,
455+ [ 5034.8682417375 , 5892817.151239874 ] ,
456+ [ 4804.8188261491 , 5892876.799252035 ] ,
457+ [ 4804.81882805645 , 5892876.799253942 ] ,
458+ [ 4551.3436274034 , 5892942.5211854 ] ,
459+ [ 2681.39599938213 , 5892784.488998892 ] ,
460+ ] ;
461+
462+ let angle = 10.0f64 / ( core:: f64:: consts:: PI / 2.0f64 ) ;
463+ let style = OutlineStyle :: new ( 150.0 ) . line_join ( LineJoin :: Round ( angle) ) ;
464+
465+ if let Some ( shape) = path. outline ( & style) . first ( ) {
466+ assert ! ( shape[ 0 ] . len( ) < 1_000 ) ;
467+ } ;
468+ }
469+
470+ #[ test]
471+ fn test_zero_length_segment_1 ( ) {
472+ let path = [
473+ [ 2681.39599938213 , 5892876.0 ] ,
474+ [ 5400.0 , 5891947.742386343 ] ,
475+ [ 5400.0 , 5892817.151239874 ] ,
476+ [ 4804.8188261491 , 5892876.799252035 ] ,
477+ [ 4804.81882805645 , 5892876.799253942 ]
478+ ] ;
479+
480+ let angle = 10.0f64 / ( core:: f64:: consts:: PI / 2.0f64 ) ;
481+ let style = OutlineStyle :: new ( 150.0 ) . line_join ( LineJoin :: Round ( angle) ) ;
482+
483+ if let Some ( shape) = path. outline ( & style) . first ( ) {
484+ assert ! ( shape[ 0 ] . len( ) < 1_000 ) ;
485+ } ;
486+ }
447487}
0 commit comments