DB & Dev Tools · Tools and machines: washes paint, strict hex, tested levels

Text fields paint each run's wash before selections and glyphs, so a
Highlight's background shows: the regex tester's matches, a mention's
link and markdown's code. A tile's value gives way and wraps in a narrow
box. Hex and percent escapes take two hex digits and no sign. Tests
cover each WCAG level at its edge, a clean exit's quiet badge, a
stopped container's line without load, and a reading past its limit.
This commit is contained in:
ZacharyZhang-NY committed 2026-09-27 11:15:50 -04:00
1 parent f7013b17ef
commit 8b6bf80adf
7 files changed
+109 -36

No files matched your search

+13 -12
View File
@@ -283,21 +283,22 @@ impl Element for TextElement {
);
let line_height = window.line_height();
window.with_content_mask(Some(ContentMask { bounds }), |window| {
let mut origins = Vec::with_capacity(prepaint.lines.len());
let mut top = Pixels::ZERO;
for (_, line) in &prepaint.lines {
origins.push(bounds.origin - scroll + point(Pixels::ZERO, top));
top += line.size(line_height).height;
}
for ((_, line), origin) in prepaint.lines.iter().zip(&origins) {
line.paint_background(*origin, line_height, TextAlign::Left, None, window, cx)
.expect("text input wash paint failed");
}
for rect in prepaint.selections.drain(..) {
window.paint_quad(fill(rect, prepaint.selection_color));
}
let mut top = Pixels::ZERO;
for (_, line) in &prepaint.lines {
line.paint(
bounds.origin - scroll + point(Pixels::ZERO, top),
line_height,
TextAlign::Left,
None,
window,
cx,
)
.expect("text input paint failed");
top += line.size(line_height).height;
for ((_, line), origin) in prepaint.lines.iter().zip(&origins) {
line.paint(*origin, line_height, TextAlign::Left, None, window, cx)
.expect("text input paint failed");
}
if let Some(caret) = prepaint.caret.take() {
window.paint_quad(fill(caret, prepaint.caret_color));