1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Pre-existing bug fix: round strikethrough and underline to pixel coord

This commit is contained in:
Emil Ernerfeldt
2025-03-28 20:24:33 +01:00
parent ed847f1a55
commit 5ecc31885c
2 changed files with 4 additions and 3 deletions

View File

@@ -1656,7 +1656,7 @@ impl Tessellator {
if a.x == b.x {
// Vertical line
let mut x = a.x;
stroke.round_coord_to_pixel(self.pixels_per_point, &mut x);
stroke.round_center_to_pixel(self.pixels_per_point, &mut x);
a.x = x;
b.x = x;
@@ -1677,7 +1677,7 @@ impl Tessellator {
if a.y == b.y {
// Horizontal line
let mut y = a.y;
stroke.round_coord_to_pixel(self.pixels_per_point, &mut y);
stroke.round_center_to_pixel(self.pixels_per_point, &mut y);
a.y = y;
b.y = y;

View File

@@ -894,7 +894,8 @@ fn add_row_hline(
let mut last_right_x = f32::NAN;
for glyph in &row.glyphs {
let (stroke, y) = stroke_and_y(glyph);
let (stroke, mut y) = stroke_and_y(glyph);
stroke.round_center_to_pixel(point_scale.pixels_per_point, &mut y);
if stroke == Stroke::NONE {
end_line(line_start.take(), last_right_x);