Skip to content

Commit

Permalink
fix(gesture): svg & webgl 手势事件不生效 (#1539) (#1540)
Browse files Browse the repository at this point in the history
* fix(gesture): svg & webgl 手势事件不生效 (#1539)

* fix(gesture): svg & webgl 手势事件不生效

* chore: commit changeset

---------

Co-authored-by: yuqi.pyq <yuqi.pyq@antgroup.com>

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

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: zengyue ye <yezengyue@gmail.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
4 people authored Oct 8, 2023
1 parent 4d9815b commit 187e9d7
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 4 deletions.
6 changes: 6 additions & 0 deletions packages/g-mobile-svg/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @antv/g-mobile-svg

## 0.10.16

### Patch Changes

- ef3ef11b: Use gesture plugin in mobile SVG & WebGL renderers.

## 0.10.15

### Patch Changes
Expand Down
3 changes: 2 additions & 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": "0.10.15",
"version": "0.10.16",
"description": "A renderer implemented by SVG in mobile environment",
"keywords": [
"antv",
Expand Down Expand Up @@ -40,6 +40,7 @@
"dependencies": {
"@antv/g-lite": "workspace:*",
"@antv/g-plugin-dragndrop": "workspace:*",
"@antv/g-plugin-gesture": "workspace:*",
"@antv/g-plugin-mobile-interaction": "workspace:*",
"@antv/g-plugin-svg-picker": "workspace:*",
"@antv/g-plugin-svg-renderer": "workspace:*",
Expand Down
15 changes: 13 additions & 2 deletions packages/g-mobile-svg/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as DragDropEvent from '@antv/g-plugin-dragndrop';
import * as MobileInteraction from '@antv/g-plugin-mobile-interaction';
import * as SVGPicker from '@antv/g-plugin-svg-picker';
import * as SVGRenderer from '@antv/g-plugin-svg-renderer';
import * as GesturePlugin from '@antv/g-plugin-gesture';
import { isNil } from '@antv/util';
import { ContextRegisterPlugin } from './ContextRegisterPlugin';

Expand All @@ -27,8 +28,12 @@ export class Renderer extends AbstractRenderer {
this.registerPlugin(new SVGPicker.Plugin());
this.registerPlugin(
new DragDropEvent.Plugin({
isDocumentDraggable: isNil(config?.isDocumentDraggable) ? true : config.isDocumentDraggable,
isDocumentDroppable: isNil(config?.isDocumentDroppable) ? true : config.isDocumentDroppable,
isDocumentDraggable: isNil(config?.isDocumentDraggable)
? true
: config.isDocumentDraggable,
isDocumentDroppable: isNil(config?.isDocumentDroppable)
? true
: config.isDocumentDroppable,
dragstartDistanceThreshold: isNil(config?.dragstartDistanceThreshold)
? 10
: config.dragstartDistanceThreshold,
Expand All @@ -37,5 +42,11 @@ export class Renderer extends AbstractRenderer {
: config.dragstartTimeThreshold,
}),
);

this.registerPlugin(
new GesturePlugin.Plugin({
isDocumentGestureEnabled: true,
}),
);
}
}
6 changes: 6 additions & 0 deletions packages/g-mobile-webgl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @antv/g-mobile-webgl

## 0.9.23

### Patch Changes

- ef3ef11b: Use gesture plugin in mobile SVG & WebGL renderers.

## 0.9.22

### Patch Changes
Expand Down
3 changes: 2 additions & 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": "0.9.22",
"version": "0.9.23",
"description": "A renderer implemented by WebGL1/2 in mobile environment",
"keywords": [
"antv",
Expand Down Expand Up @@ -41,6 +41,7 @@
"@antv/g-lite": "workspace:*",
"@antv/g-plugin-device-renderer": "workspace:*",
"@antv/g-plugin-dragndrop": "workspace:*",
"@antv/g-plugin-gesture": "workspace:*",
"@antv/g-plugin-html-renderer": "workspace:*",
"@antv/g-plugin-image-loader": "workspace:*",
"@antv/g-plugin-mobile-interaction": "workspace:*",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-mobile-webgl/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as DragDropEvent from '@antv/g-plugin-dragndrop';
import * as HTMLRenderer from '@antv/g-plugin-html-renderer';
import * as ImageLoader from '@antv/g-plugin-image-loader';
import * as DomInteraction from '@antv/g-plugin-mobile-interaction';
import * as GesturePlugin from '@antv/g-plugin-gesture';
import { isNil } from '@antv/util';
import { ContextRegisterPlugin } from './ContextRegisterPlugin';

Expand Down Expand Up @@ -52,5 +53,11 @@ export class Renderer extends AbstractRenderer {
: config.dragstartTimeThreshold,
}),
);

this.registerPlugin(
new GesturePlugin.Plugin({
isDocumentGestureEnabled: true,
}),
);
}
}
24 changes: 24 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 187e9d7

Please sign in to comment.