Skip to content

Commit 8661d8a

Browse files
authored
Test text paint orders by color (#27983)
1 parent 22f8880 commit 8661d8a

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎packages/flutter/test/rendering/editable_test.dart‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void main() {
175175
backgroundCursorColor: Colors.grey,
176176
selectionColor: Colors.black,
177177
textDirection: TextDirection.ltr,
178-
cursorColor: const Color.fromARGB(0xFF, 0xFF, 0x00, 0x00),
178+
cursorColor: Colors.red,
179179
offset: ViewportOffset.zero(),
180180
textSelectionDelegate: delegate,
181181
text: const TextSpan(
@@ -196,8 +196,8 @@ void main() {
196196
expect(
197197
editable,
198198
paints
199-
// This is a big selection rectangle, not the cursor.
200-
..rect(color: Colors.black, rect: Rect.fromLTWH(0, 0, 30, 10))
199+
// Check that it's the black selection box, not the red cursor.
200+
..rect(color: Colors.black)
201201
..paragraph(),
202202
);
203203

@@ -235,7 +235,8 @@ void main() {
235235
editable,
236236
paints
237237
..paragraph()
238-
..rect(color: Colors.red[500], rect: Rect.fromLTWH(20, 2, 1, 6)),
238+
// Red collapsed cursor is painted, not a selection box.
239+
..rect(color: Colors.red[500]),
239240
);
240241

241242
// There is exactly one rect paint (0 selection, 1 cursor).
@@ -248,7 +249,7 @@ void main() {
248249
editable,
249250
// The paint order is now flipped.
250251
paints
251-
..rect(color: Colors.red[500], rect: Rect.fromLTWH(20, 2, 1, 6))
252+
..rect(color: Colors.red[500])
252253
..paragraph(),
253254
);
254255
expect(editable, paintsExactlyCountTimes(#drawRect, 1));

0 commit comments

Comments
 (0)