File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 349349 let (cur-page , descents ) = _get-descent-at-page (loc )
350350 let cur-descent = descents . at (repr (properties . side ))
351351 dy = calc . max (0pt , cur-descent - loc . position (). y )
352- // Notes at the beginning of a line misreport their y position, since immediately
353- // after they are placed, a new line is created which moves the note down .
354- // A hacky fix is to subtract a line's worth of space from the y position when
355- // detecting a note at the beginning of a line.
356- // TODO: When https://github.com/typst/typst/issues/763 is resolved,
357- // `get` this value from `par.leading` instead of hardcoding`
358- if anchor-x == properties . margin-left {
359- dy -= 0.65em
352+ // Notes at the end of a line misreport their x position, the placed box will wrap
353+ // onto the next line and invalidate the calculated distance .
354+ // A hacky fix is to manually replace the x position to an offset of 0.
355+ let is-end-of-line = calc . abs (
356+ anchor-x - properties . margin-left - properties . page-width - properties . page-offset-x
357+ ) < 0.1pt
358+ if is-end-of-line {
359+ anchor-x -= properties . page-width
360360 }
361361 }
362362
You can’t perform that action at this time.
0 commit comments