Skip to content

Commit c8a4906

Browse files
committed
fix lint style error 2
1 parent 6b57c89 commit c8a4906

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/coord/cartesian/Grid.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,10 @@ class Grid implements CoordinateSystemMaster {
218218
gridRect.width -= lastLabelRect.width / 2 - Number(boxLayoutParams.right) + margin;
219219
}
220220
//Long first label still exceeds the left boundary even when yAxis on the left
221-
if (firstLabelRect.width / 2 >= Number(boxLayoutParams.left) + labelUnionRect.width) {
222-
gridRect.width -= firstLabelRect.width / 2 - Number(boxLayoutParams.left) - labelUnionRect.width + margin;
223-
gridRect.x += firstLabelRect.width / 2 - Number(boxLayoutParams.left) - labelUnionRect.width + margin;
221+
let leftMargin = Number(boxLayoutParams.left);
222+
if (firstLabelRect.width / 2 >= leftMargin + labelUnionRect.width) {
223+
gridRect.width -= firstLabelRect.width / 2 - leftMargin - labelUnionRect.width + margin;
224+
gridRect.x += firstLabelRect.width / 2 - leftMargin - labelUnionRect.width + margin;
224225
}
225226
}
226227
adjustAxes();

0 commit comments

Comments
 (0)