Skip to content

Commit c17534b

Browse files
Release (#1908)
* fix: image element rendering triggers an exception (#1906) * fix: image element rendering triggers an exception * chore: add image bugfix demo #1906 * chore(release): bump version (#1907) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 2f5d364 commit c17534b

File tree

35 files changed

+181
-23
lines changed

35 files changed

+181
-23
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ module.exports = {
4949
'import/no-cycle': 'warn',
5050
'import/no-duplicates': 'warn',
5151
'class-methods-use-this': 'warn',
52+
'no-console': ['warn', { allow: ['warn', 'error'] }],
5253
'no-plusplus': [
5354
'warn',
5455
{

__tests__/demos/bugfix/1906.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Canvas, Image as GImage } from '@antv/g';
2+
3+
/**
4+
* @see https://github.com/antvis/G/pull/1906
5+
*/
6+
export async function issue_1906(context: { canvas: Canvas }) {
7+
const { canvas } = context;
8+
await canvas.ready;
9+
canvas.context.config.enableLargeImageOptimization = true;
10+
11+
const img = new Image();
12+
img.onload = () => {
13+
console.log('onload', img.complete);
14+
15+
// remove && expect no error
16+
requestAnimationFrame(() => {
17+
image.remove();
18+
});
19+
};
20+
21+
let image = new GImage({
22+
style: {
23+
x: 0,
24+
y: 0,
25+
src: img,
26+
},
27+
});
28+
29+
img.src =
30+
'https://mdn.alipayobjects.com/huamei_fr7vu1/afts/img/A*SqloToP7R9QAAAAAAAAAAAAADkn0AQ/original';
31+
32+
canvas.appendChild(image);
33+
}

__tests__/demos/bugfix/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export { test_pick } from './1747';
1010
export { issue_1760 } from './1760';
1111
export { issue_1176 } from './1176';
1212
export { issue_1882 } from './1882';
13+
export { issue_1906 } from './1906';
1314
export { textWordWrap } from './textWordWrap';
1415
export { group_with_stroke } from './group-with-stroke';
1516
export { switchRenderer } from './switch-renderer';

packages/g-canvas/CHANGELOG.md

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

3+
## 2.0.40
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [cc62be4]
8+
- @antv/g-plugin-canvas-renderer@2.2.19
9+
- @antv/g-plugin-image-loader@2.1.19
10+
- @antv/g-plugin-canvas-picker@2.1.19
11+
312
## 2.0.39
413

514
### 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.39",
3+
"version": "2.0.40",
44
"description": "A renderer implemented by Canvas 2D API",
55
"keywords": [
66
"antv",

packages/g-canvaskit/CHANGELOG.md

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

3+
## 1.0.39
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [cc62be4]
8+
- @antv/g-plugin-image-loader@2.1.19
9+
- @antv/g-plugin-canvas-picker@2.1.19
10+
- @antv/g-plugin-canvaskit-renderer@2.1.19
11+
312
## 1.0.38
413

514
### 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.38",
3+
"version": "1.0.39",
44
"description": "A renderer implemented by CanvasKit",
55
"keywords": [
66
"antv",

packages/g-mobile-canvas/CHANGELOG.md

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

3+
## 1.0.37
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [cc62be4]
8+
- @antv/g-plugin-canvas-renderer@2.2.19
9+
- @antv/g-plugin-image-loader@2.1.19
10+
- @antv/g-plugin-canvas-picker@2.1.19
11+
312
## 1.0.36
413

514
### Patch Changes

packages/g-mobile-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-mobile-canvas",
3-
"version": "1.0.36",
3+
"version": "1.0.37",
44
"description": "A renderer implemented with Canvas2D API in mobile environment",
55
"keywords": [
66
"antv",

packages/g-mobile-webgl/CHANGELOG.md

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

3+
## 1.0.44
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [cc62be4]
8+
- @antv/g-plugin-image-loader@2.1.19
9+
- @antv/g-plugin-device-renderer@2.2.19
10+
311
## 1.0.43
412

513
### Patch Changes

0 commit comments

Comments
 (0)