Bug 1291528 - Fix gradient scaling in nsCSSRendering::PaintGradient - r=mstange

This commit is contained in:
Edwin Flores 2016-08-09 12:58:00 +01:00
Родитель cb82279d40
Коммит 8289246c56
1 изменённых файлов: 4 добавлений и 4 удалений

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

@ -2746,15 +2746,15 @@ nsCSSRendering::PaintGradient(nsPresContext* aPresContext,
// Fit the gradient line exactly into the source rect. // Fit the gradient line exactly into the source rect.
if (lineStart.x != lineEnd.x) { if (lineStart.x != lineEnd.x) {
rectLen = srcSize.width; rectLen = aPresContext->CSSPixelsToDevPixels(aSrc.width);
offset = ((double)aSrc.x - lineStart.x) / lineLength; offset = ((double)aSrc.x - lineStart.x) / lineLength;
lineStart.x = aSrc.x; lineStart.x = aSrc.x;
lineEnd.x = aSrc.x + srcSize.width; lineEnd.x = aSrc.x + rectLen;
} else { } else {
rectLen = srcSize.height; rectLen = aPresContext->CSSPixelsToDevPixels(aSrc.height);
offset = ((double)aSrc.y - lineStart.y) / lineLength; offset = ((double)aSrc.y - lineStart.y) / lineLength;
lineStart.y = aSrc.y; lineStart.y = aSrc.y;
lineEnd.y = aSrc.y + srcSize.height; lineEnd.y = aSrc.y + rectLen;
} }
// Adjust gradient stop positions for the new gradient line. // Adjust gradient stop positions for the new gradient line.