1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-28 11:35:35 +03:00

Draw underline

This commit is contained in:
Tae Won Ha 2019-02-21 21:44:04 +01:00
parent 246638ff96
commit f34624c1f5
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -89,6 +89,18 @@ final class AttributesRunDrawer {
) )
} }
if run.attrs.fontTrait.contains(.underline) {
guard let lastPosition = fontGlyphRuns.last?.positions.last?.x else {
return
}
let x1 = lastPosition + self.cellSize.width
let x0 = fontGlyphRuns[0].positions[0].x
let y0 = fontGlyphRuns[0].positions[0].y
CGRect(x: x0, y: y0 + self.underlinePosition,
width: x1, height: self.underlineThickness).fill()
}
// TODO: GH-666: Draw underline/curl // TODO: GH-666: Draw underline/curl
} }