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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user