diff --git a/src/effects/gradients/Sk4fLinearGradient.cpp b/src/effects/gradients/Sk4fLinearGradient.cpp index 229bf8212f..ba4d3c6a9e 100644 --- a/src/effects/gradients/Sk4fLinearGradient.cpp +++ b/src/effects/gradients/Sk4fLinearGradient.cpp @@ -295,7 +295,7 @@ public: SkScalar fx, SkScalar dx, bool is_vertical) - : fAdvX((i->fP1 - fx) / dx) + : fAdvX(is_vertical ? SK_ScalarInfinity : (i->fP1 - fx) / dx) , fFirstInterval(firstInterval) , fLastInterval(lastInterval) , fInterval(i)