File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1034,8 +1034,22 @@ class Chart {
10341034 const me = this ;
10351035 const options = me . options ;
10361036 const hoverOptions = options . hover ;
1037+
10371038 // If the event is replayed from `update`, we should evaluate with the final positions.
1039+ //
1040+ // The `replay`:
1041+ // It's the last event (excluding click) that has occured before `update`.
1042+ // So mouse has not moved. It's also over the chart, because there is a `replay`.
1043+ //
1044+ // The why:
1045+ // If animations are active, the elements haven't moved yet compared to state before update.
1046+ // But if they will, we are activating the elements that would be active, if this check
1047+ // was done after the animations have completed. => "final positions".
1048+ // If there is no animations, the "final" and "current" positions are equal.
1049+ // This is done so we do not have to evaluate the active elements each animation frame
1050+ // - it would be expensive.
10381051 const useFinalPosition = replay ;
1052+
10391053 let changed = false ;
10401054
10411055 // Find Active Elements for hover and tooltips
You can’t perform that action at this time.
0 commit comments