Skip to content

Commit

Permalink
fix: throw error when render edge without terminal (#3331)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector authored Mar 2, 2023
1 parent 309b5a7 commit a1d8642
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 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": "2.5.1",
"version": "2.6.1",
"description": "JavaScript diagramming library that uses SVG and HTML for rendering",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
6 changes: 1 addition & 5 deletions packages/x6/src/renderer/queueJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ export class JobQueue {

let job
while ((job = this.queue.shift())) {
try {
job.cb()
} catch (error) {
// pass
}
job.cb()
if (this.getCurrentTime() - startTime >= this.frameInterval) {
break
}
Expand Down
10 changes: 5 additions & 5 deletions packages/x6/src/renderer/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class Scheduler extends Disposable {
}

let result = 0
if (this.isInRenderArea(view)) {
if (this.isUpdateable(view)) {
result = this.updateView(view, flag, options)
viewItem.flag = result
} else {
Expand Down Expand Up @@ -479,11 +479,11 @@ export class Scheduler extends Disposable {
return effectedEdges
}

protected isInRenderArea(view: CellView) {
if (!this.renderArea) {
return true
}
protected isUpdateable(view: CellView) {
if (view.isNodeView()) {
if (!this.renderArea) {
return true
}
const node = view.cell
return this.renderArea.isIntersectWithRect(node.getBBox())
}
Expand Down

0 comments on commit a1d8642

Please sign in to comment.