mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-27 14:14:19 +03:00
Merge pull request #725 from tkonolige/develop
Don't round character spacing
This commit is contained in:
commit
a051e5393a
@ -26,12 +26,11 @@ final class FontUtils {
|
||||
static func cellSize(of font: NSFont, linespacing: CGFloat, characterspacing: CGFloat) -> CGSize {
|
||||
if let cached = cellSizeWithDefaultLinespacingCache.object(forKey: font) {
|
||||
return CGSize(
|
||||
width: ceil(characterspacing * cached.width),
|
||||
width: characterspacing * cached.width,
|
||||
height: ceil(linespacing * cached.height)
|
||||
)
|
||||
}
|
||||
|
||||
// adapted from here: https://github.com/gnachman/iTerm2/blob/master/sources/FontSizeEstimator.m#L66
|
||||
let capitalM = [UniChar(0x004D)]
|
||||
var glyph = [CGGlyph(0)]
|
||||
var advancement = CGSize.zero
|
||||
@ -51,7 +50,7 @@ final class FontUtils {
|
||||
)
|
||||
|
||||
let cellSize = CGSize(
|
||||
width: ceil(characterspacing * advancement.width),
|
||||
width: characterspacing * advancement.width,
|
||||
height: ceil(linespacing * cellSizeToCache.height)
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user