Enforce minimum gradient width for fill tool

This commit is contained in:
adroitwhiz 2020-07-28 16:01:49 -04:00
parent cca0832f0d
commit 379599905a

View file

@ -203,7 +203,14 @@ class FillTool extends paper.Tool {
// Only create a gradient if specifically requested, else use color1 directly
// This ensures we do not set a gradient by accident (see scratch-paint#830).
if (gradientType && gradientType !== GradientTypes.SOLID) {
item[colorProp] = createGradientObject(color1, color2, gradientType, item.bounds, pointerLocation);
item[colorProp] = createGradientObject(
color1,
color2,
gradientType,
item.bounds,
pointerLocation,
item.strokeWidth
);
} else {
item[colorProp] = color1;
}