Bug 1342571 - fix MaxStrokeExtents to account for partial pixel coverage properly. r=mstange

MozReview-Commit-ID: DS25AJKoVYo
This commit is contained in:
Lee Salzman 2017-02-28 15:48:04 -05:00
Родитель 4dfd1b6ac1
Коммит cebf845be0
2 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -372,6 +372,11 @@ PathExtentsToMaxStrokeExtents(const StrokeOptions &aStrokeOptions,
double dx = styleExpansionFactor * hypot(aTransform._11, aTransform._21);
double dy = styleExpansionFactor * hypot(aTransform._22, aTransform._12);
// Even if the stroke only partially covers a pixel, it must still render to
// full pixels. Round up to compensate for this.
dx = ceil(dx);
dy = ceil(dy);
Rect result = aRect;
result.Inflate(dx, dy);
return result;

Просмотреть файл

@ -270,6 +270,12 @@ MaxStrokeExtents(const StrokeOptions& aStrokeOptions,
double dx = styleExpansionFactor * hypot(aTransform._11, aTransform._21);
double dy = styleExpansionFactor * hypot(aTransform._22, aTransform._12);
// Even if the stroke only partially covers a pixel, it must still render to
// full pixels. Round up to compensate for this.
dx = ceil(dx);
dy = ceil(dy);
return Margin(dy, dx, dy, dx);
}