Skip to content

Commit 347f059

Browse files
committed
fix: optimize link position
1 parent 2772f81 commit 347f059

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/index.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
--root-bgcolor: #4c4f69;
99
--main-color: #444446;
1010
--main-bgcolor: #ffffff;
11+
--topic-padding: 3px;
1112
--color: #777777;
1213
--bgcolor: #f6f6f6;
1314
// ---
@@ -107,6 +108,7 @@
107108
pointer-events: all;
108109
max-width: 800px;
109110
white-space: pre-wrap;
111+
padding: var(--topic-padding);
110112
line-height: 1.2; // assure the line-height consistency between different languages
111113
.tags {
112114
direction: ltr;
@@ -223,6 +225,7 @@
223225
position: absolute;
224226
top: 0;
225227
left: 0;
228+
padding: var(--topic-padding);
226229
background-color: #fff;
227230
color: #666666;
228231
width: max-content; // let words expand the div and keep max length at the same time

src/linkDiv.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,15 @@ function generateSubLine2({ pT, pL, pW, pH, cT, cL, cW, cH, direction, isFirst }
258258
const y2 = cT + cH
259259
let x1: number, x2: number, xMid: number
260260
if (direction === 'lhs') {
261-
xMid = pL - 10
261+
xMid = pL
262262
x1 = xMid + GAP
263263
x2 = xMid - GAP
264-
end = cL + GAP - 10
264+
end = cL + GAP
265265
} else if (direction === 'rhs') {
266-
xMid = pL + pW + 10
266+
xMid = pL + pW
267267
x1 = xMid - GAP
268268
x2 = xMid + GAP
269-
end = cL + cW - GAP + 10
269+
end = cL + cW - GAP
270270
}
271271
return `M ${x1} ${y1} C ${xMid} ${y1} ${xMid} ${y2} ${x2} ${y2} H ${end}`
272272
}

0 commit comments

Comments
 (0)