* src/sdf/ftsdf.c (get_min_distance_conic): Use 0, 1 in case of 0 roots.

This commit is contained in:
Anuj Verma 2020-07-01 16:20:08 +05:30 committed by anujverma
parent f9b4f37433
commit 97474a7072
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2020-07-01 Anuj Verma <anujv@iitbhilai.ac.in>
* src/sdf/ftsdf.c (get_min_distance_conic): In case
the cubic equation returns zero root, use endpoints
for calculating the shortest distance.
2020-07-01 Anuj Verma <anujv@iitbhilai.ac.in>
[sdf] Added function to find shortest distance from a

View File

@ -1223,6 +1223,13 @@
/* find the roots */
num_roots = solve_cubic_equation( a, b, c, d, roots );
if ( num_roots == 0 )
{
roots[0] = 0;
roots[1] = FT_INT_16D16( 1 );
num_roots = 2;
}
/* convert these values to 16.16 for further computation */
aA.x = FT_26D6_16D16( aA.x );
aA.y = FT_26D6_16D16( aA.y );