From 2cc5dad887a1f4b0604e75aebde5534ff1124c01 Mon Sep 17 00:00:00 2001 From: toly <1981462002@qq.com> Date: Wed, 16 Feb 2022 22:11:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=98=E5=88=B6=E5=86=B0?= =?UTF-8?q?=E5=A2=A9=E5=A2=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/painter_system/fun/dundun_view.dart | 5 ++--- lib/painter_system/gallery_factory.dart | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/painter_system/fun/dundun_view.dart b/lib/painter_system/fun/dundun_view.dart index ead4687..3763b80 100644 --- a/lib/painter_system/fun/dundun_view.dart +++ b/lib/painter_system/fun/dundun_view.dart @@ -24,7 +24,7 @@ class _DunDunViewState extends State { } void loadImage() async { - ByteData data2 = await rootBundle.load('assets/images/logo1.png'); + ByteData data2 = await rootBundle.load('assets/images/logo1.webp'); image = await decodeImageFromList(data2.buffer.asUint8List()); if (mounted) setState(() {}); } @@ -232,11 +232,10 @@ class DunDunPainter extends CustomPainter { pathPaint..color = Colors.red; starPath = starPath.shift(Offset(152, -20)); canvas.drawPath(starPath, pathPaint); - if (image != null) { Rect src2 = Rect.fromLTWH( 0, 0, image!.width.toDouble(), image!.height.toDouble()); - Rect dst2 = Rect.fromLTWH(50, 55, 899 / 27, 1066 / 27); + Rect dst2 = Rect.fromLTWH(50, 55, 899 / 28, 1066 / 28); canvas.drawImageRect(image!, src2, dst2, Paint()); } diff --git a/lib/painter_system/gallery_factory.dart b/lib/painter_system/gallery_factory.dart index 164355c..366c693 100644 --- a/lib/painter_system/gallery_factory.dart +++ b/lib/painter_system/gallery_factory.dart @@ -113,7 +113,7 @@ class GalleryFactory { title: "冰墩墩", author: "张风捷特烈", info: - " 本样例会绘制 2022 年北京冬奥会吉祥物冰墩墩的绘制,可以学到路径绘制、渐变色等知识。", + " 本样例是绘制 2022 年北京冬奥会吉祥物冰墩墩的形体,从中可以学到路径绘制、渐变色等知识。", content: DunDunView()), FrameShower( title: "井字棋",