diff --git a/package.json b/package.json index 31710d72..c0013537 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "@parcel/transformer-image": "2.8.2", "@size-limit/preset-big-lib": "^8.1.0", "@types/mocha": "^10.0.1", - "canvas": "^2.10.2", + "canvas": "^2.11.2", "chai": "4.3.7", "filehound": "^1.17.6", "gulp": "^4.0.2", diff --git a/test/unit/Label-test.ts b/test/unit/Label-test.ts index b920b066..1f3e3162 100644 --- a/test/unit/Label-test.ts +++ b/test/unit/Label-test.ts @@ -89,7 +89,7 @@ describe('Label', function () { } else { assert.equal( trace, - 'clearRect(0,0,578,200);save();lineJoin=round;transform(1,0,0,1,-65,120);shadowColor=rgba(0,0,0,0.2);shadowBlur=10;shadowOffsetX=10;shadowOffsetY=10;beginPath();moveTo(5,0);lineTo(154,0);lineTo(164,-20);lineTo(174,0);lineTo(324,0);arc(324,5,5,4,0,false);lineTo(329,55);arc(324,55,5,0,1,false);lineTo(5,60);arc(5,55,5,1,3,false);lineTo(0,5);arc(5,5,5,3,4,false);closePath();fillStyle=#bbb;fill();restore();save();transform(1,0,0,1,-65,120);font=normal normal 50px Arial;textBaseline=middle;textAlign=left;translate(0,0);save();fillStyle=green;fillText(Hello big world,0,30);restore();restore();' + 'clearRect(0,0,578,200);save();lineJoin=round;transform(1,0,0,1,-64,120);shadowColor=rgba(0,0,0,0.2);shadowBlur=10;shadowOffsetX=10;shadowOffsetY=10;beginPath();moveTo(5,0);lineTo(153,0);lineTo(163,-20);lineTo(173,0);lineTo(322,0);arc(322,5,5,4,0,false);lineTo(327,55);arc(322,55,5,0,1,false);lineTo(5,60);arc(5,55,5,1,3,false);lineTo(0,5);arc(5,5,5,3,4,false);closePath();fillStyle=#bbb;fill();restore();save();transform(1,0,0,1,-64,120);font=normal normal 50px Arial;textBaseline=middle;textAlign=left;translate(0,0);save();fillStyle=green;fillText(Hello big world,0,30);restore();restore();' ); } }); diff --git a/test/unit/Text-test.ts b/test/unit/Text-test.ts index 280520a7..0addefad 100644 --- a/test/unit/Text-test.ts +++ b/test/unit/Text-test.ts @@ -1060,7 +1060,7 @@ describe('Text', function () { } else { assert.equal( layer.getContext().getTrace(false, true), - 'clearRect(0,0,578,200);save();transform(1,0,0,1,10,10);beginPath();rect(0,0,200,100);closePath();lineWidth=2;strokeStyle=black;stroke();restore();save();transform(1,0,0,1,10,10);font=normal normal 16px Arial;textBaseline=middle;textAlign=left;translate(10,42);save();fillStyle=#555;fillText(Some awesome text,18,8);restore();restore();' + 'clearRect(0,0,578,200);save();transform(1,0,0,1,10,10);beginPath();rect(0,0,200,100);closePath();lineWidth=2;strokeStyle=black;stroke();restore();save();transform(1,0,0,1,10,10);font=normal normal 16px Arial;textBaseline=middle;textAlign=left;translate(10,42);save();fillStyle=#555;fillText(Some awesome text,17,8);restore();restore();' ); } }); diff --git a/test/unit/TextPath-test.ts b/test/unit/TextPath-test.ts index bd322a13..e03a4095 100644 --- a/test/unit/TextPath-test.ts +++ b/test/unit/TextPath-test.ts @@ -830,11 +830,7 @@ describe('TextPath', function () { var rect = textpath.getClientRect(); // just different results in different envs - if (isBrowser) { - assert.equal(Math.round(rect.height), 330, 'check height'); - } else { - assert.equal(Math.round(rect.height), 332, 'check height'); - } + assert.equal(Math.round(rect.height), 330, 'check height'); textpath.text(''); rect = textpath.getClientRect(); @@ -880,13 +876,8 @@ describe('TextPath', function () { layer.draw(); var rect = textpath.getClientRect(); - if (isBrowser) { - assert.equal(Math.round(rect.width), 299); - assert.equal(Math.round(rect.height), 171); - } else { - assert.equal(Math.round(rect.width), 298); - assert.equal(Math.round(rect.height), 170); - } + assert.equal(Math.round(rect.width), 299); + assert.equal(Math.round(rect.height), 171); }); it.skip('check vertical text path', function () {