mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Improve point.xRange and point.yRange performance (#5062)
This commit is contained in:
parent
b04ce949d1
commit
ce1fc28b74
@ -24,12 +24,12 @@ defaults._set('global', {
|
||||
|
||||
function xRange(mouseX) {
|
||||
var vm = this._view;
|
||||
return vm ? (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hitRadius, 2)) : false;
|
||||
return vm ? (Math.abs(mouseX - vm.x) < vm.radius + vm.hitRadius) : false;
|
||||
}
|
||||
|
||||
function yRange(mouseY) {
|
||||
var vm = this._view;
|
||||
return vm ? (Math.pow(mouseY - vm.y, 2) < Math.pow(vm.radius + vm.hitRadius, 2)) : false;
|
||||
return vm ? (Math.abs(mouseY - vm.y) < vm.radius + vm.hitRadius) : false;
|
||||
}
|
||||
|
||||
module.exports = Element.extend({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user