fix sidenote tiling bug
This commit is contained in:
@ -7,11 +7,13 @@
|
||||
.counter {
|
||||
counter-increment: sidenote;
|
||||
color: #444;
|
||||
margin-left: 0.05rem;
|
||||
|
||||
&:after {
|
||||
font-size: 0.75rem;
|
||||
position: relative;
|
||||
bottom: 0.3rem;
|
||||
color: #8c0606;
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,6 +25,7 @@
|
||||
position: relative;
|
||||
font-size: 0.75rem;
|
||||
bottom: 0.2rem;
|
||||
color: #8c0606;
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,7 +106,14 @@
|
||||
return;
|
||||
}
|
||||
|
||||
let labelTop = s.label.getBoundingClientRect().y + window.scrollY;
|
||||
let labelTop = s.label.getBoundingClientRect().y;
|
||||
if (labelTop === 0) {
|
||||
// sometimes we get spurious results, only in dev mode though
|
||||
// I think it's related to hot module reloading
|
||||
return;
|
||||
}
|
||||
labelTop += window.scrollY;
|
||||
|
||||
let noteHeight = s.note.getBoundingClientRect().height;
|
||||
if (labelTop < prevBottom + minNoteGap) {
|
||||
// there is a collision
|
||||
|
Reference in New Issue
Block a user