mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-06-27 14:16:54 +08:00
feat: 优化缩略图组件的高度和宽度计算逻辑,支持根据可用尺寸动态调整
This commit is contained in:
@@ -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<Thumbnail> createState() => _Thumbnail();
|
||||
|
||||
Reference in New Issue
Block a user