Skip to content

Commit

Permalink
fix picking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoji Chen committed Mar 27, 2020
1 parent 7c857a4 commit f3097da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions modules/layers/src/path-layer/path-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@ export default class PathLayer extends Layer {
}
}

getPickingInfo({info}) {
if (info.picked && this.parent) {
const {data} = this.props;
const isDataWrapped = data[0] && data[0].__source;
if (isDataWrapped) {
info.object = data.find(d => d.__source.index === info.index);
}
getPickingInfo(params) {
const info = super.getPickingInfo(params);
const {object, index} = info;

if (object && object.__source) {
// data is wrapped
info.object = this.props.data.find(d => d.__source.index === index);
}
return info;
}
Expand Down
14 changes: 7 additions & 7 deletions modules/layers/src/solid-polygon-layer/solid-polygon-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ export default class SolidPolygonLayer extends Layer {
/* eslint-enable max-len */
}

getPickingInfo({info}) {
if (info.picked && this.parent) {
const {data} = this.props;
const isDataWrapped = data[0] && data[0].__source;
if (isDataWrapped) {
info.object = data.find(d => d.__source.index === info.index);
}
getPickingInfo(params) {
const info = super.getPickingInfo(params);
const {object, index} = info;

if (object && object.__source) {
// data is wrapped
info.object = this.props.data.find(d => d.__source.index === index);
}
return info;
}
Expand Down

0 comments on commit f3097da

Please sign in to comment.