Skip to content

Commit

Permalink
fix(grid) Simplify default rotation computation of y-axis. close #9265
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Gerling committed Jan 29, 2024
1 parent e90526c commit bca793e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/coord/axisHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,7 @@ export function computeNameBoundingRect(axis: Axis2D): BoundingRect {
}
const axisLabelModel = axisModel.getModel('nameTextStyle');
const unRotatedNameBoundingRect = axisLabelModel.getTextRect(axisModel.getModel('name').option);
const defaultRotationYAxis = (axisModel.get('nameLocation') === 'end' || axisModel.get('nameLocation') === 'start')
&& !axis.isHorizontal() ? 0 : -90;
const defaultRotation = axis.dim === 'x' ? 0 : defaultRotationYAxis;
const defaultRotation = axis.isHorizontal() ? 0 : -90;
const rotatedNameBoundingRect = rotateTextRect(
unRotatedNameBoundingRect, axisModel.getModel('nameRotate').option ?? defaultRotation
);
Expand Down

0 comments on commit bca793e

Please sign in to comment.