Skip to content

Commit

Permalink
Release (#1858)
Browse files Browse the repository at this point in the history
* fix: fix custom element with stroke may cause bounds error (#1857)

* fix: fix custom element with stroke may cause bounds error

* chore: commit changeset

* chore(release): bump version (#1859)

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>
  • Loading branch information
3 people authored Nov 27, 2024
1 parent ee852c4 commit d4752e2
Show file tree
Hide file tree
Showing 97 changed files with 479 additions and 61 deletions.
43 changes: 29 additions & 14 deletions __tests__/demos/bugfix/group-with-stroke.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Group, Path, Rect, runtime } from '@antv/g';
import { Group, Path, Rect, runtime, CustomElement } from '@antv/g';

export async function group_with_stroke(context) {
const { canvas } = context;

await canvas.ready;

const group = new Group({
class CustomGroup extends CustomElement<any> {}

const group = new CustomGroup({
style: {
stroke: 'red',
lineWidth: 6,
Expand All @@ -28,24 +30,37 @@ export async function group_with_stroke(context) {

canvas.appendChild(group);

const bounds = group.getRenderBounds();
let rect;

const {
min: [minX, minY],
max: [maxX, maxY],
} = bounds;
const width = maxX - minX;
const height = maxY - minY;
const rect = new Rect({
style: {
const upsert = () => {
const {
min: [minX, minY],
max: [maxX, maxY],
} = group.getRenderBounds();
const width = maxX - minX;
const height = maxY - minY;
const style = {
x: minX,
y: minY,
width,
height,
fill: 'green',
fillOpacity: 0.1,
},
});
zIndex: -1,
};

canvas.appendChild(rect);
if (!rect) {
rect = new Rect({ style });
canvas.appendChild(rect);
} else {
rect.attr(style);
}
};

upsert();

Object.assign(window, {
upsert,
group,
});
}
7 changes: 7 additions & 0 deletions packages/g-camera-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-camera-api

## 2.0.27

### Patch Changes

- Updated dependencies [1fb7ecc]
- @antv/g-lite@2.2.8

## 2.0.26

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-camera-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-camera-api",
"version": "2.0.26",
"version": "2.0.27",
"description": "A simple implementation of Camera API.",
"keywords": [
"antv",
Expand Down
13 changes: 13 additions & 0 deletions packages/g-canvas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @antv/g-canvas

## 2.0.31

### Patch Changes

- Updated dependencies [1fb7ecc]
- @antv/g-lite@2.2.8
- @antv/g-plugin-canvas-path-generator@2.1.8
- @antv/g-plugin-canvas-picker@2.1.10
- @antv/g-plugin-canvas-renderer@2.2.10
- @antv/g-plugin-dom-interaction@2.1.13
- @antv/g-plugin-html-renderer@2.1.13
- @antv/g-plugin-image-loader@2.1.10

## 2.0.30

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-canvas",
"version": "2.0.30",
"version": "2.0.31",
"description": "A renderer implemented by Canvas 2D API",
"keywords": [
"antv",
Expand Down
13 changes: 13 additions & 0 deletions packages/g-canvaskit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @antv/g-canvaskit

## 1.0.30

### Patch Changes

- Updated dependencies [1fb7ecc]
- @antv/g-lite@2.2.8
- @antv/g-plugin-canvas-path-generator@2.1.8
- @antv/g-plugin-canvas-picker@2.1.10
- @antv/g-plugin-canvaskit-renderer@2.1.10
- @antv/g-plugin-dom-interaction@2.1.13
- @antv/g-plugin-html-renderer@2.1.13
- @antv/g-plugin-image-loader@2.1.10

## 1.0.29

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-canvaskit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-canvaskit",
"version": "1.0.29",
"version": "1.0.30",
"description": "A renderer implemented by CanvasKit",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-components

## 2.0.24

### Patch Changes

- Updated dependencies [1fb7ecc]
- @antv/g-lite@2.2.8

## 2.0.23

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-components",
"version": "2.0.23",
"version": "2.0.24",
"description": "Components for g",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-dom-mutation-observer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-dom-mutation-observer-api

## 2.0.24

### Patch Changes

- Updated dependencies [1fb7ecc]
- @antv/g-lite@2.2.8

## 2.0.23

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-dom-mutation-observer-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-dom-mutation-observer-api",
"version": "2.0.23",
"version": "2.0.24",
"description": "A simple implementation of DOM MutationObserver API.",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-gesture/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-gesture

## 3.0.24

### Patch Changes

- Updated dependencies [1fb7ecc]
- @antv/g-lite@2.2.8

## 3.0.23

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-gesture/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-gesture",
"version": "3.0.23",
"version": "3.0.24",
"description": "G Gesture",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-image-exporter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-image-exporter

## 1.0.24

### Patch Changes

- Updated dependencies [1fb7ecc]
- @antv/g-lite@2.2.8

## 1.0.23

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-image-exporter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-image-exporter",
"version": "1.0.23",
"version": "1.0.24",
"description": "A image exporter for G using DOM API",
"keywords": [
"antv",
Expand Down
6 changes: 6 additions & 0 deletions packages/g-lite/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @antv/g-lite

## 2.2.8

### Patch Changes

- 1fb7ecc: fix: fix custom element with stroke may cause bounds error

## 2.2.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-lite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-lite",
"version": "2.2.7",
"version": "2.2.8",
"description": "A core module for rendering engine implements DOM API.",
"keywords": [
"antv",
Expand Down
15 changes: 15 additions & 0 deletions packages/g-lite/src/display-objects/CustomElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ export interface BaseCustomElementStyleProps extends BaseStyleProps {}
export abstract class CustomElement<
CustomElementStyleProps,
> extends DisplayObject<CustomElementStyleProps & BaseCustomElementStyleProps> {
static PARSED_STYLE_LIST: Set<string> = new Set([
'class',
'className',
'clipPath',
'cursor',
'draggable',
'droppable',
'opacity',
'pointerEvents',
'transform',
'transformOrigin',
'zIndex',
'visibility',
]);

isCustomElement = true;

// private shadowNodes: DisplayObject[] = [];
Expand Down
2 changes: 2 additions & 0 deletions packages/g-lite/src/display-objects/Fragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { DisplayObject } from './DisplayObject';
* @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment
*/
export class Fragment extends DisplayObject {
static PARSED_STYLE_LIST = new Set<string>(['class', 'className']);

constructor() {
super({ type: Shape.FRAGMENT });
}
Expand Down
7 changes: 7 additions & 0 deletions packages/g-lottie-player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-lottie-player

## 1.0.24

### Patch Changes

- Updated dependencies [1fb7ecc]
- @antv/g-lite@2.2.8

## 1.0.23

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-lottie-player/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-lottie-player",
"version": "1.0.23",
"version": "1.0.24",
"description": "A lottie player for G",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-mobile-canvas-element/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-mobile-canvas-element

## 1.0.24

### Patch Changes

- Updated dependencies [1fb7ecc]
- @antv/g-lite@2.2.8

## 1.0.23

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-canvas-element/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-canvas-element",
"version": "1.0.23",
"version": "1.0.24",
"description": "Create a CanvasLike element from existed context in mobile environment",
"keywords": [
"antv",
Expand Down
14 changes: 14 additions & 0 deletions packages/g-mobile-canvas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @antv/g-mobile-canvas

## 1.0.28

### Patch Changes

- Updated dependencies [1fb7ecc]
- @antv/g-lite@2.2.8
- @antv/g-plugin-canvas-path-generator@2.1.8
- @antv/g-plugin-canvas-picker@2.1.10
- @antv/g-plugin-canvas-renderer@2.2.10
- @antv/g-plugin-dragndrop@2.0.24
- @antv/g-plugin-gesture@2.0.24
- @antv/g-plugin-image-loader@2.1.10
- @antv/g-plugin-mobile-interaction@1.0.24

## 1.0.27

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-canvas",
"version": "1.0.27",
"version": "1.0.28",
"description": "A renderer implemented with Canvas2D API in mobile environment",
"keywords": [
"antv",
Expand Down
12 changes: 12 additions & 0 deletions packages/g-mobile-svg/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @antv/g-mobile-svg

## 1.0.26

### Patch Changes

- Updated dependencies [1fb7ecc]
- @antv/g-lite@2.2.8
- @antv/g-plugin-dragndrop@2.0.24
- @antv/g-plugin-gesture@2.0.24
- @antv/g-plugin-mobile-interaction@1.0.24
- @antv/g-plugin-svg-picker@2.0.26
- @antv/g-plugin-svg-renderer@2.2.8

## 1.0.25

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-svg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-svg",
"version": "1.0.25",
"version": "1.0.26",
"description": "A renderer implemented by SVG in mobile environment",
"keywords": [
"antv",
Expand Down
13 changes: 13 additions & 0 deletions packages/g-mobile-webgl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @antv/g-mobile-webgl

## 1.0.35

### Patch Changes

- Updated dependencies [1fb7ecc]
- @antv/g-lite@2.2.8
- @antv/g-plugin-device-renderer@2.2.10
- @antv/g-plugin-dragndrop@2.0.24
- @antv/g-plugin-gesture@2.0.24
- @antv/g-plugin-html-renderer@2.1.13
- @antv/g-plugin-image-loader@2.1.10
- @antv/g-plugin-mobile-interaction@1.0.24

## 1.0.34

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-webgl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-webgl",
"version": "1.0.34",
"version": "1.0.35",
"description": "A renderer implemented by WebGL1/2 in mobile environment",
"keywords": [
"antv",
Expand Down
Loading

0 comments on commit d4752e2

Please sign in to comment.