update CHANGELOG with new version

This commit is contained in:
Anton Lavrenov
2023-05-14 07:31:29 -06:00
parent 3c0c6c8a3e
commit e6ecd4399b
3 changed files with 34 additions and 3 deletions

View File

@@ -9,7 +9,6 @@ import {
loadImage,
isBrowser,
isNode,
assertAlmostEqual,
} from './test-utils';
describe('Text', function () {
@@ -102,7 +101,7 @@ describe('Text', function () {
assert.equal(
layer.getContext().getTrace(false, true),
'clearRect(0,0,578,200);save();transform(1,0,0,1,40,40);shadowColor=rgba(255,0,0,0.2);shadowBlur=1;shadowOffsetX=10;shadowOffsetY=10;font=normal normal 50px Arial;textBaseline=middle;textAlign=left;translate(10,10);save();fillStyle=#888;fillText(Hello World!,108,30);lineWidth=2;shadowColor=rgba(0,0,0,0);strokeStyle=#333;strokeText(Hello World!,108,30);restore();restore();'
'clearRect(0,0,578,200);save();transform(1,0,0,1,40,40);shadowColor=rgba(255,0,0,0.2);shadowBlur=1;shadowOffsetX=10;shadowOffsetY=10;font=normal normal 50px Arial;textBaseline=middle;textAlign=left;translate(10,10);save();fillStyle=#888;fillText(Hello World!,108,30);lineWidth=2;shadowColor=rgba(0,0,0,0);strokeStyle=#333;miterLimit=2;strokeText(Hello World!,108,30);restore();restore();'
);
assert.equal(text.getClassName(), 'Text', 'getClassName should be Text');
@@ -1185,6 +1184,7 @@ describe('Text', function () {
context.scale(2, 1);
context.textBaseline = 'middle';
context.fillText('text', 0, 25);
context.miterLimit = 2;
context.strokeText('text', 0, 25);
compareLayerAndCanvas(layer, canvas);
});
@@ -1561,4 +1561,28 @@ describe('Text', function () {
done();
});
});
it('stripe bad stroke', () => {
var stage = addStage();
var layer = new Konva.Layer();
stage.add(layer);
var text = new Konva.Text({
text: 'HELLO WORLD',
fontFamily: 'Arial',
fontSize: 80,
stroke: 'red',
strokeWidth: 20,
fillAfterStrokeEnabled: true,
draggable: true,
});
layer.add(text);
layer.draw();
var trace =
'clearRect(0,0,578,200);clearRect(0,0,578,200);save();transform(1,0,0,1,0,0);font=normal normal 80px Arial;textBaseline=middle;textAlign=left;translate(0,0);save();lineWidth=20;strokeStyle=red;miterLimit=2;strokeText(HELLO WORLD,0,40);fillStyle=black;fillText(HELLO WORLD,0,40);restore();restore();';
assert.equal(layer.getContext().getTrace(), trace);
});
});