Skip to content

Commit

Permalink
chore: 🔧 code format and update version (antvis#2282)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector authored Jun 29, 2022
1 parent e4f38cd commit a60e8f1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/x6/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/x6",
"version": "1.32.3",
"version": "1.32.4",
"description": "JavaScript diagramming library that uses SVG and HTML for rendering.",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
3 changes: 2 additions & 1 deletion packages/x6/src/addon/selection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ export class Selection extends View<Selection.EventArgs> {
allowTranslating = allowTranslating && ui && !selection

// Avoid circular calls of child nodes
allowTranslating = allowTranslating && translateBy && node.id === translateBy
allowTranslating =
allowTranslating && translateBy && node.id === translateBy

if (allowTranslating) {
this.translating = true
Expand Down
2 changes: 1 addition & 1 deletion packages/x6/src/global/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/**
* Auto generated version file, do not modify it!
*/
const version = '1.32.3'
const version = '1.32.4'
export { version }
18 changes: 10 additions & 8 deletions packages/x6/src/view/edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2337,23 +2337,25 @@ export class EdgeView<
data: EventData.ArrowheadDragging,
) {
const graph = this.graph
const { snap, allowEdge } = graph.options.connecting;
const radius = (typeof snap === 'object' && snap.radius) || 50;
const { snap, allowEdge } = graph.options.connecting
const radius = (typeof snap === 'object' && snap.radius) || 50

const findViewsOption = {
x: x - radius,
y: y - radius,
width: 2 * radius,
height: 2 * radius,
};
}

const views = graph.renderer.findViewsInArea(findViewsOption);
const views = graph.renderer.findViewsInArea(findViewsOption)

if (allowEdge) {
const edgeViews = graph.renderer.findEdgeViewsInArea(findViewsOption).filter( view => {
return view != this;
});
views.push(...edgeViews);
const edgeViews = graph.renderer
.findEdgeViewsInArea(findViewsOption)
.filter((view) => {
return view !== this
})
views.push(...edgeViews)
}

const prevView = data.closestView || null
Expand Down
3 changes: 1 addition & 2 deletions packages/x6/src/view/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ export class NodeView<
targetMagnet: magnet,
})
// onMouseDown 需要阻止冒泡,解决 #2216
this.stopPropagation(e);
this.stopPropagation(e)
if (graph.hook.validateMagnet(this, magnet, e)) {
if (graph.options.magnetThreshold <= 0) {
this.startConnectting(e, magnet, x, y)
Expand All @@ -977,7 +977,6 @@ export class NodeView<
this.setEventData<Partial<EventData.Magnet>>(e, {
action: 'magnet',
})

} else {
this.onMouseDown(e, x, y)
}
Expand Down

0 comments on commit a60e8f1

Please sign in to comment.