Use toStringAsFixed in DecorationImage.toString (#131026)
This makes the output less sensitive on JS int vs double shenanigans.
This commit is contained in:
parent
c53cfc555e
commit
8a01c9b707
@ -236,8 +236,8 @@ class DecorationImage {
|
||||
'$repeat',
|
||||
if (matchTextDirection)
|
||||
'match text direction',
|
||||
'scale $scale',
|
||||
'opacity $opacity',
|
||||
'scale ${scale.toStringAsFixed(1)}',
|
||||
'opacity ${opacity.toStringAsFixed(1)}',
|
||||
'$filterQuality',
|
||||
if (invertColors)
|
||||
'invert colors',
|
||||
|
@ -333,6 +333,19 @@ void main() {
|
||||
expect(paint.invertColors, !kIsWeb);
|
||||
});
|
||||
|
||||
test('DecorationImage.toString', () async {
|
||||
expect(
|
||||
DecorationImage(
|
||||
image: SynchronousTestImageProvider(
|
||||
await createTestImage(width: 100, height: 100),
|
||||
),
|
||||
opacity: 0.99,
|
||||
scale: 2.01,
|
||||
).toString(),
|
||||
'DecorationImage(SynchronousTestImageProvider(), Alignment.center, scale 2.0, opacity 1.0, FilterQuality.low)',
|
||||
);
|
||||
});
|
||||
|
||||
test('DecorationImage with null textDirection configuration should throw Error', () async {
|
||||
const ColorFilter colorFilter = ui.ColorFilter.mode(Color(0xFF00FF00), BlendMode.src);
|
||||
final ui.Image image = await createTestImage(width: 100, height: 100);
|
||||
|
Loading…
x
Reference in New Issue
Block a user