-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release #1908
Merged
Release #1908
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Canvas, Image as GImage } from '@antv/g'; | ||
|
||
/** | ||
* @see https://github.com/antvis/G/pull/1906 | ||
*/ | ||
export async function issue_1906(context: { canvas: Canvas }) { | ||
const { canvas } = context; | ||
await canvas.ready; | ||
canvas.context.config.enableLargeImageOptimization = true; | ||
|
||
const img = new Image(); | ||
img.onload = () => { | ||
console.log('onload', img.complete); | ||
|
||
// remove && expect no error | ||
requestAnimationFrame(() => { | ||
image.remove(); | ||
}); | ||
}; | ||
|
||
let image = new GImage({ | ||
style: { | ||
x: 0, | ||
y: 0, | ||
src: img, | ||
}, | ||
}); | ||
|
||
img.src = | ||
'https://mdn.alipayobjects.com/huamei_fr7vu1/afts/img/A*SqloToP7R9QAAAAAAAAAAAAADkn0AQ/original'; | ||
|
||
canvas.appendChild(image); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
# @antv/g-canvas | ||
|
||
## 2.0.40 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [cc62be4] | ||
- @antv/[email protected] | ||
- @antv/[email protected] | ||
- @antv/[email protected] | ||
|
||
## 2.0.39 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
# @antv/g-canvaskit | ||
|
||
## 1.0.39 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [cc62be4] | ||
- @antv/[email protected] | ||
- @antv/[email protected] | ||
- @antv/[email protected] | ||
|
||
## 1.0.38 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
# @antv/g-mobile-canvas | ||
|
||
## 1.0.37 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [cc62be4] | ||
- @antv/[email protected] | ||
- @antv/[email protected] | ||
- @antv/[email protected] | ||
|
||
## 1.0.36 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
# @antv/g-mobile-webgl | ||
|
||
## 1.0.44 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [cc62be4] | ||
- @antv/[email protected] | ||
- @antv/[email protected] | ||
|
||
## 1.0.43 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# @antv/g-plugin-3d | ||
|
||
## 2.0.42 | ||
|
||
### Patch Changes | ||
|
||
- @antv/[email protected] | ||
|
||
## 2.0.41 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# @antv/g-plugin-canvas-picker | ||
|
||
## 2.1.19 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [cc62be4] | ||
- @antv/[email protected] | ||
|
||
## 2.1.18 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
# @antv/g-plugin-canvas-renderer | ||
|
||
## 2.2.19 | ||
|
||
### Patch Changes | ||
|
||
- cc62be4: fix: image element rendering triggers an exception | ||
- Updated dependencies [cc62be4] | ||
- @antv/[email protected] | ||
|
||
## 2.2.18 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,14 +47,19 @@ export class ImageRenderer extends DefaultRenderer { | |
if (!imageCache.downSampled) { | ||
this.imagePool | ||
.createDownSampledImage(src, object) | ||
.then((res) => { | ||
.then(() => { | ||
// be removed from dom tree | ||
if (!object.ownerDocument) { | ||
return; | ||
} | ||
|
||
// rerender | ||
// object.dirty(); | ||
object.renderable.dirty = true; | ||
object.ownerDocument.defaultView.context.renderingService.dirtify(); | ||
}) | ||
.catch(() => { | ||
// | ||
.catch((reason) => { | ||
console.error(reason); | ||
}); | ||
|
||
return; | ||
|
@@ -92,15 +97,20 @@ export class ImageRenderer extends DefaultRenderer { | |
src, | ||
[], | ||
() => { | ||
// be removed from dom tree | ||
if (!object.ownerDocument) { | ||
return; | ||
} | ||
|
||
// rerender | ||
// object.dirty(); | ||
object.renderable.dirty = true; | ||
object.ownerDocument.defaultView.context.renderingService.dirtify(); | ||
}, | ||
object, | ||
) | ||
.catch(() => { | ||
// | ||
.catch((reason) => { | ||
console.error(reason); | ||
}); | ||
|
||
return; | ||
|
@@ -244,7 +254,9 @@ export class ImageRenderer extends DefaultRenderer { | |
imageRect, | ||
drawRect, | ||
}); | ||
} catch {} | ||
} catch { | ||
// expected error | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Catching an empty block without handling or logging the error might lead to silent failures. Consider logging the error or handling it appropriately to avoid missing critical issues. |
||
} | ||
} | ||
|
||
// --- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# @antv/g-plugin-canvaskit-renderer | ||
|
||
## 2.1.19 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [cc62be4] | ||
- @antv/[email protected] | ||
|
||
## 2.1.18 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# @antv/g-plugin-device-renderer | ||
|
||
## 2.2.19 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [cc62be4] | ||
- @antv/[email protected] | ||
|
||
## 2.2.18 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# @antv/g-plugin-rough-canvas-renderer | ||
|
||
## 2.0.40 | ||
|
||
### Patch Changes | ||
|
||
- @antv/[email protected] | ||
|
||
## 2.0.39 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# @antv/g-plugin-zdog-canvas-renderer | ||
|
||
## 2.0.39 | ||
|
||
### Patch Changes | ||
|
||
- @antv/[email protected] | ||
|
||
## 2.0.38 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# @antv/g-web-components | ||
|
||
## 2.0.46 | ||
|
||
### Patch Changes | ||
|
||
- @antv/[email protected] | ||
- @antv/[email protected] | ||
|
||
## 2.0.45 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable
image
is used before it is defined. This will lead to a runtime error. Consider definingimage
before using it in therequestAnimationFrame
callback.