Skip to content

Commit

Permalink
chore: remove debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
xuefei1313 committed Jan 22, 2024
1 parent 14bf05d commit aba39d8
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions packages/vchart/src/component/axis/cartesian/axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,26 +291,24 @@ export abstract class CartesianAxis<T extends ICartesianAxisCommonSpec = ICartes
onLayoutStart(layoutRect: IRect, viewRect: ILayoutRect, ctx: any): void {
super.onLayoutStart(layoutRect, viewRect, ctx);
// 计算innerOffset
if (!isZAxis(this.getOrient())) {
if (!isZAxis(this.getOrient()) && (this._spec as ICartesianVertical | ICartesianHorizontal).innerOffset) {
const spec = this._spec as ICartesianVertical | ICartesianHorizontal;
if (spec.innerOffset) {
if (isYAxis(this.getOrient())) {
['top', 'bottom'].forEach(orient => {
this._innerOffset[orient] = calcLayoutNumber(
(spec as ICartesianVertical).innerOffset[orient],
viewRect.height,
viewRect
);
});
} else {
['left', 'right'].forEach(orient => {
this._innerOffset[orient] = calcLayoutNumber(
(spec as ICartesianHorizontal).innerOffset[orient],
viewRect.width,
viewRect
);
});
}
if (isYAxis(this.getOrient())) {
['top', 'bottom'].forEach(orient => {
this._innerOffset[orient] = calcLayoutNumber(
(spec as ICartesianVertical).innerOffset[orient],
viewRect.height,
viewRect
);
});
} else {
['left', 'right'].forEach(orient => {
this._innerOffset[orient] = calcLayoutNumber(
(spec as ICartesianHorizontal).innerOffset[orient],
viewRect.width,
viewRect
);
});
}
}
}
Expand Down

0 comments on commit aba39d8

Please sign in to comment.