Skip to content

Commit

Permalink
fix: failed to execute 'addColorStop' on 'CanvasGradient'
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickshan committed Oct 16, 2024
1 parent b774904 commit f84f057
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/render/canvas/canvas-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ export class CanvasRenderer extends Renderer {
const ctx = canvas.getContext('2d') as CanvasRenderingContext2D;
const gradient = ctx.createLinearGradient(x0, y0, x1, y1);

processColorStops(backgroundImage.stops, lineLength).forEach((colorStop) =>
processColorStops(backgroundImage.stops, lineLength || 1).forEach((colorStop) =>
gradient.addColorStop(colorStop.stop, asString(colorStop.color))
);

Expand Down

0 comments on commit f84f057

Please sign in to comment.