Skip to content

Commit 2cc5dad

Browse files
committed
优化绘制冰墩墩
1 parent 2ea12bc commit 2cc5dad

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/painter_system/fun/dundun_view.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class _DunDunViewState extends State<DunDunView> {
2424
}
2525

2626
void loadImage() async {
27-
ByteData data2 = await rootBundle.load('assets/images/logo1.png');
27+
ByteData data2 = await rootBundle.load('assets/images/logo1.webp');
2828
image = await decodeImageFromList(data2.buffer.asUint8List());
2929
if (mounted) setState(() {});
3030
}
@@ -232,11 +232,10 @@ class DunDunPainter extends CustomPainter {
232232
pathPaint..color = Colors.red;
233233
starPath = starPath.shift(Offset(152, -20));
234234
canvas.drawPath(starPath, pathPaint);
235-
236235
if (image != null) {
237236
Rect src2 = Rect.fromLTWH(
238237
0, 0, image!.width.toDouble(), image!.height.toDouble());
239-
Rect dst2 = Rect.fromLTWH(50, 55, 899 / 27, 1066 / 27);
238+
Rect dst2 = Rect.fromLTWH(50, 55, 899 / 28, 1066 / 28);
240239

241240
canvas.drawImageRect(image!, src2, dst2, Paint());
242241
}

lib/painter_system/gallery_factory.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class GalleryFactory {
113113
title: "冰墩墩",
114114
author: "张风捷特烈",
115115
info:
116-
" 本样例会绘制 2022 年北京冬奥会吉祥物冰墩墩的绘制,可以学到路径绘制、渐变色等知识。",
116+
" 本样例是绘制 2022 年北京冬奥会吉祥物冰墩墩的形体,从中可以学到路径绘制、渐变色等知识。",
117117
content: DunDunView()),
118118
FrameShower(
119119
title: "井字棋",

0 commit comments

Comments
 (0)