Fixed bug in libtess. Fixes #1210

master
Marius Kintel 2015-02-09 18:42:17 -05:00
parent b2f2323f6b
commit c50d927216
1 changed files with 6 additions and 5 deletions

View File

@ -1122,11 +1122,12 @@ static void InitEdgeDict( TESStesselator *tess )
h = (tess->bmax[1] - tess->bmin[1]);
/* If the bbox is empty, ensure that sentinels are not coincident by
slightly enlarging it. */
smin = tess->bmin[0] - (w > 0 ? w : 0.01);
smax = tess->bmax[0] + (w > 0 ? w : 0.01);
tmin = tess->bmin[1] - (h > 0 ? h : 0.01);
tmax = tess->bmax[1] + (h > 0 ? h : 0.01);
slightly enlarging it. To avoid floating point precision issues,
make sure to enlarge by a minimal amount. */
smin = tess->bmin[0] - (w > 0.01 ? w : 0.01);
smax = tess->bmax[0] + (w > 0.01 ? w : 0.01);
tmin = tess->bmin[1] - (h > 0.01 ? h : 0.01);
tmax = tess->bmax[1] + (h > 0.01 ? h : 0.01);
AddSentinel( tess, smin, smax, tmin );
AddSentinel( tess, smin, smax, tmax );