Automattic / Automattic/node-canvas
Mask on item over path are not correct.
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
```
ctx.fillStyle = "#FF0000";
ctx.lineTo(0, 100);
ctx.lineTo(100, 100);
ctx.lineTo(100, 0);
ctx.lineTo(0, 0);
ctx.fill();
ctx.save();
ctx.rect(0,0,50,50);
ctx.clip();
ctx.fillStyle = "#00FF00";
ctx.fillRect(0,0,100,100);
ctx.restore();
```
With this code, I'm getting this :

But if I don't make a mistake, I should get this :

Contributor guide
No contributing guide indexed for this repository
Research direction
Run the provided canvas snippet in node-canvas and compare its clipping output with the expected image. Trace the behavior of save(), rect(), clip(), fillRect(), and restore() to identify where the mask diverges, then confirm the corrected result with the same reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100