Skip to content

Commit

Permalink
Fix SelectionUpdateOp update always repainting
Browse files Browse the repository at this point in the history
Override the equalValue member to do a deep equality test
The default equality test doesn't actually look at values.
This causes a render after every selection, even if nothing has changed.
For graphs with a lot of points this caused a severe slowdown.
  • Loading branch information
alert-dan committed Sep 17, 2023
1 parent e987cad commit 7471f9a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/src/interaction/selection/selection.dart
Expand Up @@ -415,4 +415,12 @@ class SelectionUpdateOp extends Operator<AttributesGroups> {
}
return rst;
}

///Need to provide a semantic equality comparison since
///AttributesGroups are really just an alias to a list
@override
bool equalValue(AttributesGroups a, AttributesGroups b){
return deepCollectionEquals(a, b);
}

}

0 comments on commit 7471f9a

Please sign in to comment.