Skip to content

Commit 3dacde8

Browse files
Release (#1923)
* fix: element z-index sorting rendering abnormality (#1921) * chore(release): bump version (#1922) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent c9905e3 commit 3dacde8

File tree

100 files changed

+581
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+581
-95
lines changed

__tests__/demos/bugfix/1910.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { Canvas, Text, CanvasEvent } from '@antv/g';
2+
import { Renderer } from '@antv/g-canvas';
3+
4+
// const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
5+
// const randomLetter = () => letters.charAt(Math.floor(Math.random() * 26));
6+
7+
/**
8+
* @see https://github.com/antvis/G/issues/1910
9+
*/
10+
export async function issue_1910(context: { canvas: Canvas }) {
11+
const { canvas } = context;
12+
console.log(canvas);
13+
14+
canvas.setRenderer(
15+
new Renderer({
16+
enableAutoRendering: false,
17+
}),
18+
);
19+
20+
const canvasDom = canvas
21+
.getContextService()
22+
.getDomElement() as unknown as HTMLCanvasElement;
23+
const btnDom = document.createElement('button');
24+
btnDom.style.cssText =
25+
'position: absolute; top: 0px; left: 600px; width: 120px; height: 32px';
26+
btnDom.textContent = 'trigger render';
27+
28+
canvasDom.parentElement.appendChild(btnDom);
29+
30+
const text1 = new Text({
31+
style: {
32+
x: 100,
33+
y: 200,
34+
text: 'A',
35+
fontSize: 16,
36+
fill: '#f00',
37+
zIndex: 1, // zIndex 为 0 或不配置时,一切正常
38+
},
39+
});
40+
41+
const text2 = new Text({
42+
style: {
43+
x: 100,
44+
y: 300,
45+
text: 'B',
46+
fontSize: 16,
47+
fill: '#000',
48+
},
49+
});
50+
51+
canvas.addEventListener(CanvasEvent.READY, () => {
52+
canvas.appendChild(text1);
53+
canvas.appendChild(text2);
54+
canvas.render();
55+
56+
btnDom.onclick = () => {
57+
canvas.removeChild(text1);
58+
canvas.removeChild(text2);
59+
console.log('removed');
60+
61+
canvas.render(); // 添加这行代码后不会出现锯齿,但会有图元丢失问题
62+
63+
// text1.style.text = randomLetter();
64+
text1.style.zIndex = Math.round(Math.random());
65+
// text2.style.text = randomLetter();
66+
67+
canvas.appendChild(text1);
68+
canvas.appendChild(text2);
69+
console.log('appended');
70+
71+
canvas.render();
72+
};
73+
});
74+
}

__tests__/demos/bugfix/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export { issue_1760 } from './1760';
1111
export { issue_1176 } from './1176';
1212
export { issue_1882 } from './1882';
1313
export { issue_1906 } from './1906';
14+
export { issue_1910 } from './1910';
1415
export { issue_1911 } from './1911';
1516
export { textWordWrap } from './textWordWrap';
1617
export { group_with_stroke } from './group-with-stroke';

packages/g-camera-api/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @antv/g-camera-api
22

3+
## 2.0.36
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [802cf7d]
8+
- @antv/g-lite@2.2.17
9+
310
## 2.0.35
411

512
### Patch Changes

packages/g-camera-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g-camera-api",
3-
"version": "2.0.35",
3+
"version": "2.0.36",
44
"description": "A simple implementation of Camera API.",
55
"keywords": [
66
"antv",

packages/g-canvas/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# @antv/g-canvas
22

3+
## 2.0.41
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [802cf7d]
8+
- @antv/g-plugin-canvas-renderer@2.2.20
9+
- @antv/g-lite@2.2.17
10+
- @antv/g-plugin-canvas-picker@2.1.20
11+
- @antv/g-plugin-canvas-path-generator@2.1.17
12+
- @antv/g-plugin-dom-interaction@2.1.22
13+
- @antv/g-plugin-html-renderer@2.1.22
14+
- @antv/g-plugin-image-loader@2.1.20
15+
316
## 2.0.40
417

518
### Patch Changes

packages/g-canvas/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g-canvas",
3-
"version": "2.0.40",
3+
"version": "2.0.41",
44
"description": "A renderer implemented by Canvas 2D API",
55
"keywords": [
66
"antv",

packages/g-canvaskit/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# @antv/g-canvaskit
22

3+
## 1.0.40
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [802cf7d]
8+
- @antv/g-plugin-canvaskit-renderer@2.1.20
9+
- @antv/g-lite@2.2.17
10+
- @antv/g-plugin-canvas-picker@2.1.20
11+
- @antv/g-plugin-canvas-path-generator@2.1.17
12+
- @antv/g-plugin-dom-interaction@2.1.22
13+
- @antv/g-plugin-html-renderer@2.1.22
14+
- @antv/g-plugin-image-loader@2.1.20
15+
316
## 1.0.39
417

518
### Patch Changes

packages/g-canvaskit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g-canvaskit",
3-
"version": "1.0.39",
3+
"version": "1.0.40",
44
"description": "A renderer implemented by CanvasKit",
55
"keywords": [
66
"antv",

packages/g-components/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @antv/g-components
22

3+
## 2.0.33
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [802cf7d]
8+
- @antv/g-lite@2.2.17
9+
310
## 2.0.32
411

512
### Patch Changes

packages/g-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g-components",
3-
"version": "2.0.32",
3+
"version": "2.0.33",
44
"description": "Components for g",
55
"keywords": [
66
"antv",

0 commit comments

Comments
 (0)