forked from minhngoc25a/freetype2
* src/sdf/ftsdf.c (get_min_distance_conic): Use 0, 1 in case of 0 roots.
This commit is contained in:
parent
f9b4f37433
commit
97474a7072
|
@ -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>
|
2020-07-01 Anuj Verma <anujv@iitbhilai.ac.in>
|
||||||
|
|
||||||
[sdf] Added function to find shortest distance from a
|
[sdf] Added function to find shortest distance from a
|
||||||
|
|
|
@ -1223,6 +1223,13 @@
|
||||||
/* find the roots */
|
/* find the roots */
|
||||||
num_roots = solve_cubic_equation( a, b, c, d, 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 */
|
/* convert these values to 16.16 for further computation */
|
||||||
aA.x = FT_26D6_16D16( aA.x );
|
aA.x = FT_26D6_16D16( aA.x );
|
||||||
aA.y = FT_26D6_16D16( aA.y );
|
aA.y = FT_26D6_16D16( aA.y );
|
||||||
|
|
Loading…
Reference in New Issue