mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
btex: <a> tag underlines
This commit is contained in:
BIN
lib/TerrarumSansBitmap.jar
LFS
BIN
lib/TerrarumSansBitmap.jar
LFS
Binary file not shown.
@@ -356,7 +356,7 @@ data class BTeXClickable(
|
||||
}
|
||||
|
||||
fun drawUnderline(pixmap: Pixmap, doc: BTeXDocument) {
|
||||
if (drawUnderline && width > 1) {
|
||||
if (drawUnderline) {
|
||||
val x = posX - HBPADH + doc.pageMarginH
|
||||
val y = posY - HBPADV + doc.pageMarginV + UNDERLINE_Y
|
||||
val width = width + HBPADH
|
||||
@@ -391,7 +391,8 @@ class BTeXPage(
|
||||
if (drawCall.isNotBlank()) drawCalls.add(drawCall)
|
||||
}
|
||||
fun appendClickable(clickable: BTeXClickable) {
|
||||
clickableElements.add(clickable)
|
||||
if (clickable.width > 1)
|
||||
clickableElements.add(clickable)
|
||||
}
|
||||
|
||||
private var prerender = false
|
||||
|
||||
@@ -1717,8 +1717,8 @@ object BTeXParser {
|
||||
// get width of "word"
|
||||
val searchStrs = slugs.typesettedSlugs.subList(subset.first, subset.first + subset.second)
|
||||
searchStrs.forEach { str ->
|
||||
// printdbg("2HREF searchStr: ${str.toReadable()}")
|
||||
// printdbg("2HREF object: ${objSeq.toReadable()} (id=${hrefDict[objSeq.toReadable()]})")
|
||||
printdbg("2HREF searchStr: ${str.toReadable()}")
|
||||
printdbg("2HREF object: ${objSeq.toReadable()} (id=${hrefDict[objSeq.toReadable()]})")
|
||||
|
||||
val indexOfSequence = str.indexOfSequence(objSeq)
|
||||
|
||||
@@ -1739,8 +1739,8 @@ object BTeXParser {
|
||||
// retrieve the actual word
|
||||
val substr = CodepointSequence(str.subList(wordOffset + 1, wordEnd))
|
||||
|
||||
// printdbg("2HREF word: ${substr.toReadable()}")
|
||||
// printdbg("2HREF hrefObj: ${hrefObj}")
|
||||
printdbg("2HREF word: ${substr.toReadable()}")
|
||||
printdbg("2HREF hrefObj: ${hrefObj}")
|
||||
|
||||
val hrefX = if (objectIsSplit) 0 else hrefObj.x
|
||||
var hrefY = hrefObj.y; if (objectIsSplit) hrefY += doc.lineHeightInPx
|
||||
@@ -1754,7 +1754,7 @@ object BTeXParser {
|
||||
}
|
||||
// target word is on the next line (probably)
|
||||
else {
|
||||
// printdbg("2HREF object was cut off by the linebreak")
|
||||
printdbg("2HREF object was cut off by the linebreak")
|
||||
objectIsSplit = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user