Skip to content

Node canvas Path2D issue #36

@gaitat

Description

@gaitat

Can this package be used with a canvas that comes from a createCanvas() call of the canvas npm module?

When I try to use it as

import { Canvas, CanvasRenderingContext2D, createCanvas } from 'canvas';
import 'path2d-polyfill';

const canvasElement: Canvas = createCanvas(500, 500);
const context: CanvasRenderingContext2D = canvasElement.getContext('2d');
context.fill(new Path2D("M 80 80 A 45 45 0 0 0 125 125 L 125 80 Z"));

I get ReferenceError: Path2D is not defined

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions