Skip to content

Commit

Permalink
fix: 修复对类型换图点击选中的问题 #682
Browse files Browse the repository at this point in the history
  • Loading branch information
zengyue committed Nov 7, 2019
1 parent 679aadd commit 10c4b04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/geom/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ class Geom extends Base {
});

// special for pie chart
if (this.hasAdjust('stack') && coord.isPolar && coord.transposed && xScale.values.length === 1) {
if (this.hasAdjust('stack') && coord.isPolar && coord.transposed) {
if (invertPointX >= 0 && invertPointX <= 1) {
let yValue = yScale.invert(invertPoint.y);
yValue = self._getSnap(yScale, yValue, tmp);
Expand Down
12 changes: 6 additions & 6 deletions test/bug/issue-67-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,20 @@ describe('getSnapRecords', () => {
let records;

canvas.onclick = ev => {
const point = chart.get('canvas').getPointByClient(ev.clientX, ev.clientY);
const point = { x: ev.clientX, y: ev.clientY };
records = chart.getSnapRecords(point);
};

gestureSimulator(canvas, 'click', {
clientX: 277,
clientY: 71
clientY: 113
});

setTimeout(function() {
expect(records.length).to.equal(2);
expect(records[0]._origin.a).to.equal(records[1]._origin.a);
expect(records[0]._origin.b).to.equal(0.4);
expect(records[1]._origin.b).to.equal(0.6);
expect(records.length).to.equal(1);
expect(records[0]._origin.a).to.equal('2');
expect(records[0]._origin.b).to.equal(0.5);
expect(records[0]._origin.c).to.equal('1');
chart.destroy();
document.body.removeChild(canvas);
done();
Expand Down

0 comments on commit 10c4b04

Please sign in to comment.