mirror of https://gitee.com/antv-l7/antv-l7
fix(pick): event
This commit is contained in:
parent
99e128d11d
commit
bb03cd02cf
|
@ -42,7 +42,7 @@ class Picking {
|
||||||
// this._world._container.addEventListener('mousemove', this._onWorldMove.bind(this), false);
|
// this._world._container.addEventListener('mousemove', this._onWorldMove.bind(this), false);
|
||||||
}
|
}
|
||||||
pickdata(event) {
|
pickdata(event) {
|
||||||
const point = { x: event.clientX, y: event.clientY, type: event.type };
|
const point = { x: event.offsetX, y: event.offsetY, type: event.type };
|
||||||
const normalisedPoint = { x: 0, y: 0 };
|
const normalisedPoint = { x: 0, y: 0 };
|
||||||
normalisedPoint.x = (point.x / this._width) * 2 - 1;
|
normalisedPoint.x = (point.x / this._width) * 2 - 1;
|
||||||
normalisedPoint.y = -(point.y / this._height) * 2 + 1;
|
normalisedPoint.y = -(point.y / this._height) * 2 + 1;
|
||||||
|
|
Loading…
Reference in New Issue