Unverified Commit 8661d8ae authored by xster's avatar xster Committed by GitHub

Test text paint orders by color (#27983)

parent 22f88809
...@@ -175,7 +175,7 @@ void main() { ...@@ -175,7 +175,7 @@ void main() {
backgroundCursorColor: Colors.grey, backgroundCursorColor: Colors.grey,
selectionColor: Colors.black, selectionColor: Colors.black,
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
cursorColor: const Color.fromARGB(0xFF, 0xFF, 0x00, 0x00), cursorColor: Colors.red,
offset: ViewportOffset.zero(), offset: ViewportOffset.zero(),
textSelectionDelegate: delegate, textSelectionDelegate: delegate,
text: const TextSpan( text: const TextSpan(
...@@ -196,8 +196,8 @@ void main() { ...@@ -196,8 +196,8 @@ void main() {
expect( expect(
editable, editable,
paints paints
// This is a big selection rectangle, not the cursor. // Check that it's the black selection box, not the red cursor.
..rect(color: Colors.black, rect: Rect.fromLTWH(0, 0, 30, 10)) ..rect(color: Colors.black)
..paragraph(), ..paragraph(),
); );
...@@ -235,7 +235,8 @@ void main() { ...@@ -235,7 +235,8 @@ void main() {
editable, editable,
paints paints
..paragraph() ..paragraph()
..rect(color: Colors.red[500], rect: Rect.fromLTWH(20, 2, 1, 6)), // Red collapsed cursor is painted, not a selection box.
..rect(color: Colors.red[500]),
); );
// There is exactly one rect paint (0 selection, 1 cursor). // There is exactly one rect paint (0 selection, 1 cursor).
...@@ -248,7 +249,7 @@ void main() { ...@@ -248,7 +249,7 @@ void main() {
editable, editable,
// The paint order is now flipped. // The paint order is now flipped.
paints paints
..rect(color: Colors.red[500], rect: Rect.fromLTWH(20, 2, 1, 6)) ..rect(color: Colors.red[500])
..paragraph(), ..paragraph(),
); );
expect(editable, paintsExactlyCountTimes(#drawRect, 1)); expect(editable, paintsExactlyCountTimes(#drawRect, 1));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment