updateDraggingObjects method
Ultra-fast surgical update only for dragging objects
Implementation
void updateDraggingObjects(List<T> objects) {
if (!_isDragging) return;
bool hasSignificantChange = false;
// Track bounds changes for surgical updates
for (final object in objects) {
if (_draggingObjectIds.contains(object.id)) {
final newBounds = object.getBounds();
final oldBounds = _draggingObjectBounds[object.id];
// Only update if bounds actually changed significantly
if (oldBounds == null || !_boundsAreSimilar(oldBounds, newBounds)) {
_spatialRects[object.id] = newBounds;
_draggingObjectBounds[object.id] = newBounds;
// Surgical grid update - only update this object's grid cells
_updateSpatialGridSurgical(object, newBounds, oldBounds);
hasSignificantChange = true;
}
}
}
// Only update derived data if there were significant changes
if (hasSignificantChange) {
_computeDraggingBounds();
_invalidateCacheForDragging();
}
}