Mask on item over path are not correct.
Author: NanardCreated Jan 23, 2015Updated Aug 22, 2026
LabelsBug
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 :

Source: Automattic/node-canvas