Skip to content

Commit

Permalink
improve font rendering for hidpi
Browse files Browse the repository at this point in the history
  • Loading branch information
Grokmoo committed Dec 23, 2023
1 parent fec5078 commit 6fae700
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl<'a, D: DrawList> FontRenderer<'a, D> {
fn draw_cur_word(&mut self) {
for font_char in self.cur_word.drain(..) {
let x = (self.pos.x * self.scale_factor).round() / self.scale_factor;
let y = ((self.pos.y + font_char.y_offset + self.font.ascent) * self.scale_factor).round() / self.scale_factor;
let y = (self.pos.y + font_char.y_offset + self.font.ascent).round();

self.draw_list.push_rect(
[x, y],
Expand Down

0 comments on commit 6fae700

Please sign in to comment.