Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
30b0ce73
by Alexei Podtelezhnikov at 2023-09-11T16:34:36+00:00
1 changed file:
Changes:
... | ... | @@ -37,6 +37,7 @@ |
37 | 37 | |
38 | 38 | |
39 | 39 | #include "psft.h"
|
40 | +#include <freetype/internal/ftcalc.h>
|
|
40 | 41 | #include <freetype/internal/ftdebug.h>
|
41 | 42 | #include <freetype/internal/services/svcfftl.h>
|
42 | 43 | |
... | ... | @@ -2276,9 +2277,8 @@ |
2276 | 2277 | arg = cf2_stack_popFixed( opStack );
|
2277 | 2278 | if ( arg > 0 )
|
2278 | 2279 | {
|
2279 | - /* use a start value that doesn't make */
|
|
2280 | - /* the algorithm's addition overflow */
|
|
2281 | - FT_Fixed root = arg < 10 ? arg : arg >> 1;
|
|
2280 | + /* initial guess based on the most significant bit */
|
|
2281 | + FT_Fixed root = 1 << ( ( 17 + FT_MSB( arg ) ) >> 1 );
|
|
2282 | 2282 | FT_Fixed new_root;
|
2283 | 2283 | |
2284 | 2284 |