Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Type: the blink-phase test finds the caret by its strokes

itsF4LCON3bca0123b04f
diff --git a/crates/ui-egui/src/type_tool.rs b/crates/ui-egui/src/type_tool.rs
index 88119f917..44c0c9b03 100644
--- a/crates/ui-egui/src/type_tool.rs
+++ b/crates/ui-egui/src/type_tool.rs
@@ -2732,7 +2732,7 @@ mod tests {
draw_overlay(app, &painter, &xf);
});
out.textures_delta.clear();
- out.shapes.iter().any(|s| matches!(&s.shape, egui::Shape::LineSegment { stroke, .. } if (stroke.width - 1.5).abs() < 1e-4))
+ out.shapes.iter().any(|s| matches!(&s.shape, egui::Shape::LineSegment { stroke, .. } if CARET_STROKES.contains(stroke)))
};
// Before resetting, the caret is in the off phase at t = 10.5 s (10500 / 530 = 19, odd phase)