Skip to content

Commit

Permalink
fix: 改为用 adjust 判断
Browse files Browse the repository at this point in the history
  • Loading branch information
El-Chiang committed Oct 28, 2021
1 parent 92098a5 commit e36e325
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/f2-next/src/components/area/withArea.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { jsx } from '../../jsx';
import { isArray, mix } from '@antv/util';
import { isArray, mix, each } from '@antv/util';
import Geometry from '../geometry';
import { GeomType } from '../geometry/interface';
import { Stack } from '../../adjust';
import { splitArray } from '../geometry/util';
import { each } from '@antv/util';

export default (View) => {
return class Area extends Geometry {
Expand Down Expand Up @@ -46,9 +46,10 @@ export default (View) => {
const record = data[j];
const { x, y } = record;

// stack 转换后的 y 为一个数组
mix(record, coord.convertPoint({ x, y: isArray(y) ? y[1] : y }));
const py0 = isArray(y) ? coord.convertPoint({ x, y: y[0] }).y : baseY;
// stack 转换后的 y 为一个数组 [y0, y1]
const isStack = this.adjust instanceof Stack;
mix(record, coord.convertPoint({ x, y: isStack ? y[1] : y }));
const py0 = isStack ? coord.convertPoint({ x, y: y[0] }).y : baseY;
record.y0 = py0;
}
}
Expand Down

0 comments on commit e36e325

Please sign in to comment.