From f51e4fb697d4a105c31331872fdb1752c3db864b Mon Sep 17 00:00:00 2001 From: lifegpc Date: Sat, 8 Mar 2025 20:21:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE=E7=BB=84=E4=BB=B6=E7=9A=84=E9=AB=98=E5=BA=A6=E5=92=8C?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=A0=B9=E6=8D=AE=E5=8F=AF=E7=94=A8=E5=B0=BA?= =?UTF-8?q?=E5=AF=B8=E5=8A=A8=E6=80=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/thumbnail.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/components/thumbnail.dart b/lib/components/thumbnail.dart index 7e5ccb8..be2309c 100644 --- a/lib/components/thumbnail.dart +++ b/lib/components/thumbnail.dart @@ -56,14 +56,18 @@ class Thumbnail extends StatefulWidget { int get height => _height != null ? _height! - : _pMeta.height > _pMeta.width - ? _max - : _max * _pMeta.height ~/ _pMeta.width; + : _width != null + ? _width! * _pMeta.height ~/ _pMeta.width + : _pMeta.height > _pMeta.width + ? _max + : _max * _pMeta.height ~/ _pMeta.width; int get width => _width != null ? _width! - : _pMeta.width > _pMeta.height - ? _max - : _max * _pMeta.width ~/ _pMeta.height; + : _height != null + ? _height! * _pMeta.width ~/ _pMeta.height + : _pMeta.width > _pMeta.height + ? _max + : _max * _pMeta.width ~/ _pMeta.height; @override State createState() => _Thumbnail();