mirror of
https://github.com/wisplite/BLE-mesh-sim.git
synced 2026-10-30 13:32:21 -05:00
sendPacket rendering optimizations
This commit is contained in:
@@ -33,6 +33,7 @@ class CompleteNodeOnEdgeEngine {
|
||||
this.speedMultiplier = 1;
|
||||
this.timeAccumulator = 0;
|
||||
this._movementInitialized = false;
|
||||
this._isDragging = false;
|
||||
|
||||
// Keep linksByEdges up-to-date for dynamic graph changes
|
||||
if (this.nodes && this.nodes.on) {
|
||||
@@ -127,6 +128,7 @@ class CompleteNodeOnEdgeEngine {
|
||||
});
|
||||
|
||||
this.network.on('dragging', (params) => {
|
||||
this._isDragging = true;
|
||||
if (params.edges.length <= 0) {
|
||||
return;
|
||||
}
|
||||
@@ -139,6 +141,10 @@ class CompleteNodeOnEdgeEngine {
|
||||
});
|
||||
});
|
||||
|
||||
this.network.on('dragEnd', (params) => {
|
||||
this._isDragging = false;
|
||||
});
|
||||
|
||||
this.network.on('physicsMoving', (params) => {
|
||||
this.edgesMoved = true;
|
||||
// Only clear cache for edges that have moving dots
|
||||
@@ -284,7 +290,8 @@ class CompleteNodeOnEdgeEngine {
|
||||
});
|
||||
|
||||
// Request canvas redraw without forcing full network re-render
|
||||
if (this.movingDots.size > 0) {
|
||||
// Skip during dragging as vis-network handles redraws automatically
|
||||
if (this.movingDots.size > 0 && !this._isDragging) {
|
||||
this.network.canvas.body.emitter.emit("_requestRedraw");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user