Index: src/effects/gradients/SkLinearGradient.cpp |
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp |
index bfa473c0123eefa1d2831953513eff65700bf8b8..f47b6ab30e7fa81392abd02afe9a5a89f38d687c 100644 |
--- a/src/effects/gradients/SkLinearGradient.cpp |
+++ b/src/effects/gradients/SkLinearGradient.cpp |
@@ -896,7 +896,7 @@ void SkLinearGradient::LinearGradientContext::shade4_clamp(int x, int y, SkPMCol |
const float dither[2] = { dither0, dither1 }; |
const float invDx = 1 / dx; |
- if (SkScalarNearlyZero(dx)) { // gradient is vertical |
+ if (SkScalarNearlyZero(dx * count)) { // gradient is vertical |
const float pinFx = SkTPin(fx, 0.0f, 1.0f); |
Sk4f c = lerp_color(pinFx, find_forward(fRecs.begin(), pinFx)); |
if (fApplyAlphaAfterInterp) { |