diff options
| author | Francesco Abbate <francesco.bbt@gmail.com> | 2021-03-20 23:20:30 +0100 |
|---|---|---|
| committer | Francesco Abbate <francesco.bbt@gmail.com> | 2021-03-20 23:20:30 +0100 |
| commit | 225f21ea99c28d2c0f816b3c5cdf879b95248d54 (patch) | |
| tree | a6bdd6ab6afd849385aac4c4194dbbcd995b7dda /plugins | |
| parent | 82a7737bf9d6dc76d3f54ccfbdf0fb0637fadc99 (diff) | |
| download | pragtical-plugins-225f21ea99c28d2c0f816b3c5cdf879b95248d54.tar.gz pragtical-plugins-225f21ea99c28d2c0f816b3c5cdf879b95248d54.zip | |
Fix drawwhitespace plugin for subpixel positioning
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/drawwhitespace.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/drawwhitespace.lua b/plugins/drawwhitespace.lua index c6ed07d..4e2e109 100644 --- a/plugins/drawwhitespace.lua +++ b/plugins/drawwhitespace.lua @@ -16,17 +16,18 @@ function DocView:draw_line_text(idx, x, y) if not config.draw_whitespace then return end local text = self.doc.lines[idx] - local tx, ty = x, y + self:get_line_text_y_offset() local font = self:get_font() + local ss = font:subpixel_scale() + local tx, ty = ss * x, y + self:get_line_text_y_offset() local color = style.whitespace or style.syntax.comment local map = config.whitespace_map for chr in common.utf8_chars(text) do local rep = map[chr] if rep then - renderer.draw_text(font, rep, tx, ty, color) + renderer.draw_text_subpixel(font, rep, tx, ty, color) end - tx = tx + font:get_width(chr) + tx = tx + font:get_width_subpixel(chr) end end |
