Format nine-slice rendering test

This commit is contained in:
gem
2026-06-09 16:04:37 +08:00
parent 220bb0aba1
commit 4f36d68b74

View File

@@ -300,19 +300,22 @@ void main() {
expect(parts.last.source, const Rect.fromLTRB(30.5, 40.5, 39.5, 49.5)); expect(parts.last.source, const Rect.fromLTRB(30.5, 40.5, 39.5, 49.5));
}); });
test('keeps tiny nine-slice source rects when inset would collapse them', () { test(
final parts = runtimeNineSliceRects( 'keeps tiny nine-slice source rects when inset would collapse them',
source: const Rect.fromLTWH(0, 0, 3, 3), () {
destination: const Rect.fromLTWH(0, 0, 30, 30), final parts = runtimeNineSliceRects(
sliceLeft: 1, source: const Rect.fromLTWH(0, 0, 3, 3),
sliceTop: 1, destination: const Rect.fromLTWH(0, 0, 30, 30),
sliceRight: 1, sliceLeft: 1,
sliceBottom: 1, sliceTop: 1,
sourceInset: 0.5, sliceRight: 1,
); sliceBottom: 1,
sourceInset: 0.5,
);
expect(parts[4].source, const Rect.fromLTRB(1, 1, 2, 2)); expect(parts[4].source, const Rect.fromLTRB(1, 1, 2, 2));
}); },
);
test('updates text alpha style without rebuilding text component', () { test('updates text alpha style without rebuilding text component', () {
final component = RuntimeComponent( final component = RuntimeComponent(