Compare commits
2 Commits
v2.0.6-bet
...
v2.0.6-bet
Author | SHA1 | Date | |
---|---|---|---|
c9494e7f79 | |||
1e7f132bed |
@ -3,6 +3,7 @@ import { Graph, Node, Cell } from '@antv/x6'
|
||||
import { Path } from '@antv/x6-geometry'
|
||||
import { register } from '@antv/x6-react-shape'
|
||||
import { Selection } from '@antv/x6-plugin-selection'
|
||||
import { Snapline } from '@antv/x6-plugin-snapline'
|
||||
import '../index.less'
|
||||
import './index.less'
|
||||
interface NodeStatus {
|
||||
@ -381,6 +382,7 @@ export default class Example extends React.Component {
|
||||
rubberband: true,
|
||||
})
|
||||
graph.use(selection)
|
||||
graph.use(new Snapline({ enabled: true }))
|
||||
|
||||
graph.on('edge:connected', ({ edge }) => {
|
||||
edge.attr({
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "2.0.6-beta.21",
|
||||
"version": "2.0.6-beta.22",
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"command": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/x6-plugin-selection",
|
||||
"version": "2.0.6-beta.20",
|
||||
"version": "2.0.6-beta.22",
|
||||
"description": "selection plugin for X6.",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
|
@ -119,7 +119,8 @@ export class SelectionImpl extends View<SelectionImpl.EventArgs> {
|
||||
options,
|
||||
}: Collection.EventArgs['node:change:position']) {
|
||||
const { showNodeSelectionBox, pointerEvents } = this.options
|
||||
const { ui, selection, translateBy } = options
|
||||
const { ui, selection, translateBy, snapped } = options
|
||||
|
||||
let allowTranslating = !this.translating
|
||||
|
||||
/* Scenarios where this method is not called:
|
||||
@ -135,6 +136,9 @@ export class SelectionImpl extends View<SelectionImpl.EventArgs> {
|
||||
allowTranslating =
|
||||
allowTranslating && translateBy && node.id === translateBy
|
||||
|
||||
// enabled when snapline snapped
|
||||
allowTranslating = allowTranslating || snapped
|
||||
|
||||
if (allowTranslating) {
|
||||
this.translating = true
|
||||
const current = node.position()
|
||||
|
Reference in New Issue
Block a user