Skip to content

Commit

Permalink
Release (#1728)
Browse files Browse the repository at this point in the history
* fix: fix setZoomByViewportPoint (#1727)

* chore: commit changeset (#1729)

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

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 Jul 9, 2024
1 parent eef62b9 commit f340e62
Show file tree
Hide file tree
Showing 98 changed files with 473 additions and 48 deletions.
1 change: 1 addition & 0 deletions __tests__/demos/camera/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { setZoomByViewportPoint } from './set-zoom-by-viewport-point';
32 changes: 32 additions & 0 deletions __tests__/demos/camera/set-zoom-by-viewport-point.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Circle } from '../../../packages/g';
import type { Camera, FederatedWheelEvent } from '../../../packages/g';

export async function setZoomByViewportPoint(context) {
const { canvas } = context;
await canvas.ready;

const circle = new Circle({
style: {
cx: 100,
cy: 100,
r: 50,
fill: 'red',
},
});

canvas.appendChild(circle);

const camera: Camera = canvas.getCamera();

canvas.addEventListener('wheel', (event: FederatedWheelEvent) => {
const {
viewport: { x, y },
deltaY,
} = event;

const zoom = camera.getZoom();
const ratio = deltaY > 0 ? 0.9 : 1.1;

camera.setZoomByViewportPoint(zoom * ratio, [x, y]);
});
}
2 changes: 2 additions & 0 deletions __tests__/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import * as lottie from './demos/lottie';
import * as perf from './demos/perf';
import * as bugfix from './demos/bugfix';
import * as event from './demos/event';
import * as camera from './demos/camera';

const tests = {
...createSpecRender(namespace(basic2d, '2d')),
Expand All @@ -29,6 +30,7 @@ const tests = {
...createSpecRender(namespace(bugfix, 'bugfix')),
...createSpecRender(namespace(perf, 'perf')),
...createSpecRender(namespace(event, 'event')),
...createSpecRender(namespace(camera, 'camera')),
};

const renderers = {
Expand Down
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.9

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6

## 2.0.8

### 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.8",
"version": "2.0.9",
"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.8

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6
- @antv/g-plugin-canvas-path-generator@2.0.6
- @antv/g-plugin-canvas-picker@2.0.7
- @antv/g-plugin-canvas-renderer@2.0.7
- @antv/g-plugin-dom-interaction@2.0.6
- @antv/g-plugin-html-renderer@2.0.7
- @antv/g-plugin-image-loader@2.0.6

## 2.0.7

### 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.7",
"version": "2.0.8",
"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.8

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6
- @antv/g-plugin-canvas-path-generator@2.0.6
- @antv/g-plugin-canvas-picker@2.0.7
- @antv/g-plugin-canvaskit-renderer@2.0.7
- @antv/g-plugin-dom-interaction@2.0.6
- @antv/g-plugin-html-renderer@2.0.7
- @antv/g-plugin-image-loader@2.0.6

## 1.0.7

### 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.7",
"version": "1.0.8",
"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.6

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6

## 2.0.5

### 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.5",
"version": "2.0.6",
"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.6

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6

## 2.0.5

### 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.5",
"version": "2.0.6",
"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.6

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6

## 3.0.5

### 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.5",
"version": "3.0.6",
"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.6

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6

## 1.0.5

### 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.5",
"version": "1.0.6",
"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.0.6

### Patch Changes

- a950bbc7: publish g-lite

## 2.0.5

### 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.0.5",
"version": "2.0.6",
"description": "A core module for rendering engine implements DOM API.",
"keywords": [
"antv",
Expand Down
6 changes: 5 additions & 1 deletion packages/g-lite/src/camera/Camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,11 @@ export class Camera implements ICamera {
const dx = vec3.dot(dvec, this.right) / vec3.length(this.right);
const dy = vec3.dot(dvec, this.up) / vec3.length(this.up);

this.pan(-dx, -dy);
const [px, py] = this.getPosition();
const [fx, fy] = this.getFocalPoint();

this.setPosition(px - dx, py - dy);
this.setFocalPoint(fx - dx, fy - dy);

return this;
}
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.6

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6

## 1.0.5

### 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.5",
"version": "1.0.6",
"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.6

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6

## 1.0.5

### 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.5",
"version": "1.0.6",
"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.7

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6
- @antv/g-plugin-canvas-path-generator@2.0.6
- @antv/g-plugin-canvas-picker@2.0.7
- @antv/g-plugin-canvas-renderer@2.0.7
- @antv/g-plugin-dragndrop@2.0.6
- @antv/g-plugin-gesture@2.0.6
- @antv/g-plugin-image-loader@2.0.6
- @antv/g-plugin-mobile-interaction@1.0.6

## 1.0.6

### 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.6",
"version": "1.0.7",
"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.8

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6
- @antv/g-plugin-dragndrop@2.0.6
- @antv/g-plugin-gesture@2.0.6
- @antv/g-plugin-mobile-interaction@1.0.6
- @antv/g-plugin-svg-picker@2.0.8
- @antv/g-plugin-svg-renderer@2.0.8

## 1.0.7

### 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.7",
"version": "1.0.8",
"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.11

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6
- @antv/g-plugin-device-renderer@2.0.10
- @antv/g-plugin-dragndrop@2.0.6
- @antv/g-plugin-gesture@2.0.6
- @antv/g-plugin-html-renderer@2.0.7
- @antv/g-plugin-image-loader@2.0.6
- @antv/g-plugin-mobile-interaction@1.0.6

## 1.0.10

### 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.10",
"version": "1.0.11",
"description": "A renderer implemented by WebGL1/2 in mobile environment",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-pattern/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-pattern

## 2.0.6

### Patch Changes

- Updated dependencies [a950bbc7]
- @antv/g-lite@2.0.6

## 2.0.5

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-pattern/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-pattern",
"version": "2.0.5",
"version": "2.0.6",
"description": "A pattern libs for G",
"keywords": [
"antv",
Expand Down
Loading

0 comments on commit f340e62

Please sign in to comment.