Skip to content

Commit

Permalink
Make cleaner, suggested by @kurkle
Browse files Browse the repository at this point in the history
Co-authored-by: Jukka Kurkela <[email protected]>
  • Loading branch information
ikkala and kurkle authored Nov 15, 2024
1 parent b9b5165 commit e1cd506
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ function zoomStart(chart, event, zoomOptions) {
}

export function mouseDown(chart, event) {
const rect = event.target.getBoundingClientRect();
const offsetX = event.clientX - rect.left;
const offsetY = event.clientY - rect.top;
if (chart.legend && _isPointInArea({x: offsetX, y: offsetY}, chart.legend)) {
if (chart.legend) {
const point = getRelativePosition(event, chart);
if (_isPointInArea(point, chart.legend)) {
return;
}
}
}
const state = getState(chart);
const {pan: panOptions, zoom: zoomOptions = {}} = state.options;
if (
Expand Down

0 comments on commit e1cd506

Please sign in to comment.