Skip to content

Commit 29efaab

Browse files
committed
Round the cursor corner positions to match the box character rendering
1 parent 92e20bd commit 29efaab

File tree

1 file changed

+8
-8
lines changed
  • src/renderer/cursor_renderer

1 file changed

+8
-8
lines changed

src/renderer/cursor_renderer/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,10 @@ impl CursorRenderer {
532532
// corners.
533533
let mut path = Path::new();
534534

535-
path.move_to(to_skia_point(self.corners[0].current_position));
536-
path.line_to(to_skia_point(self.corners[1].current_position));
537-
path.line_to(to_skia_point(self.corners[2].current_position));
538-
path.line_to(to_skia_point(self.corners[3].current_position));
535+
path.move_to(to_skia_point(self.corners[0].current_position.round()));
536+
path.line_to(to_skia_point(self.corners[1].current_position.round()));
537+
path.line_to(to_skia_point(self.corners[2].current_position.round()));
538+
path.line_to(to_skia_point(self.corners[3].current_position.round()));
539539
path.close();
540540

541541
canvas.draw_path(&path, paint);
@@ -544,10 +544,10 @@ impl CursorRenderer {
544544

545545
fn draw_rectangular_outline(&self, canvas: &Canvas, paint: &Paint, outline_width: f32) -> Path {
546546
let mut rectangle = Path::new();
547-
rectangle.move_to(to_skia_point(self.corners[0].current_position));
548-
rectangle.line_to(to_skia_point(self.corners[1].current_position));
549-
rectangle.line_to(to_skia_point(self.corners[2].current_position));
550-
rectangle.line_to(to_skia_point(self.corners[3].current_position));
547+
rectangle.move_to(to_skia_point(self.corners[0].current_position.round()));
548+
rectangle.line_to(to_skia_point(self.corners[1].current_position.round()));
549+
rectangle.line_to(to_skia_point(self.corners[2].current_position.round()));
550+
rectangle.line_to(to_skia_point(self.corners[3].current_position.round()));
551551
rectangle.close();
552552

553553
let offsets: [PixelVec<f32>; 4] = [

0 commit comments

Comments
 (0)