mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 10:12:34 +08:00
update CHANGELOG with new version
This commit is contained in:
parent
3c0c6c8a3e
commit
e6ecd4399b
@ -3,6 +3,10 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
### 9.0.2 (2023-05-14)
|
||||||
|
|
||||||
|
- Better text rendering when it has stroke
|
||||||
|
|
||||||
### 9.0.1 (2023-04-17)
|
### 9.0.1 (2023-04-17)
|
||||||
|
|
||||||
- Better performance for any instance creation
|
- Better performance for any instance creation
|
||||||
|
@ -98,7 +98,9 @@ function getDummyContext() {
|
|||||||
if (dummyContext) {
|
if (dummyContext) {
|
||||||
return dummyContext;
|
return dummyContext;
|
||||||
}
|
}
|
||||||
dummyContext = Util.createCanvasElement().getContext(CONTEXT_2D) as CanvasRenderingContext2D;
|
dummyContext = Util.createCanvasElement().getContext(
|
||||||
|
CONTEXT_2D
|
||||||
|
) as CanvasRenderingContext2D;
|
||||||
return dummyContext;
|
return dummyContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,6 +108,7 @@ function _fillFunc(context: Context) {
|
|||||||
context.fillText(this._partialText, this._partialTextX, this._partialTextY);
|
context.fillText(this._partialText, this._partialTextX, this._partialTextY);
|
||||||
}
|
}
|
||||||
function _strokeFunc(context: Context) {
|
function _strokeFunc(context: Context) {
|
||||||
|
context.setAttr('miterLimit', 2);
|
||||||
context.strokeText(this._partialText, this._partialTextX, this._partialTextY);
|
context.strokeText(this._partialText, this._partialTextX, this._partialTextY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ import {
|
|||||||
loadImage,
|
loadImage,
|
||||||
isBrowser,
|
isBrowser,
|
||||||
isNode,
|
isNode,
|
||||||
assertAlmostEqual,
|
|
||||||
} from './test-utils';
|
} from './test-utils';
|
||||||
|
|
||||||
describe('Text', function () {
|
describe('Text', function () {
|
||||||
@ -102,7 +101,7 @@ describe('Text', function () {
|
|||||||
|
|
||||||
assert.equal(
|
assert.equal(
|
||||||
layer.getContext().getTrace(false, true),
|
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');
|
assert.equal(text.getClassName(), 'Text', 'getClassName should be Text');
|
||||||
@ -1185,6 +1184,7 @@ describe('Text', function () {
|
|||||||
context.scale(2, 1);
|
context.scale(2, 1);
|
||||||
context.textBaseline = 'middle';
|
context.textBaseline = 'middle';
|
||||||
context.fillText('text', 0, 25);
|
context.fillText('text', 0, 25);
|
||||||
|
context.miterLimit = 2;
|
||||||
context.strokeText('text', 0, 25);
|
context.strokeText('text', 0, 25);
|
||||||
compareLayerAndCanvas(layer, canvas);
|
compareLayerAndCanvas(layer, canvas);
|
||||||
});
|
});
|
||||||
@ -1561,4 +1561,28 @@ describe('Text', function () {
|
|||||||
done();
|
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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user