Caret · whole device pixels at a device pixel: gpui snapped a 1.5px bar's edges apart, so it painted 1 or 2 pixels by where it stood (#7)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-08 21:45:52 -04:00
1 parent cbf63c6945
commit 33df23c02a
6 files changed
+90 -12

No files matched your search

+6 -4
View File
@@ -12,6 +12,7 @@ use super::{
links::Target,
view::Terminal,
};
use crate::primitives::caret_bar;
/// How a terminal paints: font and cell, ink, and the colors of what it marks.
pub(crate) struct Look {
@@ -161,10 +162,11 @@ pub(crate) fn grid(
(CursorShape::HollowBlock, _) | (_, false) => {
outline(Bounds::new(origin, cell), look.caret, BorderStyle::Solid)
}
(CursorShape::Beam, true) => fill(
Bounds::new(origin, size(look.caret_width, cell.height)),
look.caret,
),
(CursorShape::Beam, true) => {
let scale = window.scale_factor();
let bar = caret_bar(origin, look.caret_width, cell.height, scale);
fill(bar, look.caret)
}
(CursorShape::Underline, true) => fill(
Bounds::new(
origin + point(Pixels::ZERO, cell.height - look.caret_width),