Automattic / Automattic/node-canvas
Changing the width or height of the canvas between saving and restoring canvas state
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
## Issue
Changing the `width` or `height` of the canvas between saving and restoring canvas state causes you can draw anything onto the canvas anymore.
For the following snippet, I expect to see a blue rect onto the canvas but it draws nothing.
## Steps to Reproduce
```js
const canvas = createCanvas(100, 100);
const ctx = canvas.getContext("2d");
ctx.save();
canvas.width = 200;
canvas.height = 200;
ctx.restore();
ctx.fillStyle = "blue";
ctx.fillRect(20, 20, 50, 50);
```
## Your Environment
* Version of node-canvas: 2.11.0
* Environment: node 16.17.1 on Mac OS X 12.6
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.