From 8289246c56e6b2ca8cf2f940db61c718b803e6a9 Mon Sep 17 00:00:00 2001 From: Edwin Flores Date: Tue, 9 Aug 2016 12:58:00 +0100 Subject: [PATCH] Bug 1291528 - Fix gradient scaling in nsCSSRendering::PaintGradient - r=mstange --- layout/base/nsCSSRendering.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index 6c2b8f9694bf..a3c0fbc6d392 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -2746,15 +2746,15 @@ nsCSSRendering::PaintGradient(nsPresContext* aPresContext, // Fit the gradient line exactly into the source rect. if (lineStart.x != lineEnd.x) { - rectLen = srcSize.width; + rectLen = aPresContext->CSSPixelsToDevPixels(aSrc.width); offset = ((double)aSrc.x - lineStart.x) / lineLength; lineStart.x = aSrc.x; - lineEnd.x = aSrc.x + srcSize.width; + lineEnd.x = aSrc.x + rectLen; } else { - rectLen = srcSize.height; + rectLen = aPresContext->CSSPixelsToDevPixels(aSrc.height); offset = ((double)aSrc.y - lineStart.y) / lineLength; lineStart.y = aSrc.y; - lineEnd.y = aSrc.y + srcSize.height; + lineEnd.y = aSrc.y + rectLen; } // Adjust gradient stop positions for the new gradient line.