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',
|
'$repeat',
|
||||||
if (matchTextDirection)
|
if (matchTextDirection)
|
||||||
'match text direction',
|
'match text direction',
|
||||||
'scale $scale',
|
'scale ${scale.toStringAsFixed(1)}',
|
||||||
'opacity $opacity',
|
'opacity ${opacity.toStringAsFixed(1)}',
|
||||||
'$filterQuality',
|
'$filterQuality',
|
||||||
if (invertColors)
|
if (invertColors)
|
||||||
'invert colors',
|
'invert colors',
|
||||||
|
@ -333,6 +333,19 @@ void main() {
|
|||||||
expect(paint.invertColors, !kIsWeb);
|
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 {
|
test('DecorationImage with null textDirection configuration should throw Error', () async {
|
||||||
const ColorFilter colorFilter = ui.ColorFilter.mode(Color(0xFF00FF00), BlendMode.src);
|
const ColorFilter colorFilter = ui.ColorFilter.mode(Color(0xFF00FF00), BlendMode.src);
|
||||||
final ui.Image image = await createTestImage(width: 100, height: 100);
|
final ui.Image image = await createTestImage(width: 100, height: 100);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user