no background when the entry cannot be transparent
This commit is contained in:
parent
154bb5ade1
commit
ea96ef188a
1 changed files with 4 additions and 2 deletions
|
@ -207,6 +207,7 @@ class _ThumbnailImageState extends State<ThumbnailImage> {
|
||||||
|
|
||||||
final thumbnailWidth = isMosaic ? extent * entry.displayAspectRatio : extent;
|
final thumbnailWidth = isMosaic ? extent * entry.displayAspectRatio : extent;
|
||||||
final thumbnailHeight = extent;
|
final thumbnailHeight = extent;
|
||||||
|
final canHaveAlpha = entry.canHaveAlpha;
|
||||||
|
|
||||||
final fit = widget.fit ??
|
final fit = widget.fit ??
|
||||||
(entry.isSvg
|
(entry.isSvg
|
||||||
|
@ -224,9 +225,10 @@ class _ThumbnailImageState extends State<ThumbnailImage> {
|
||||||
: Selector<Settings, EntryBackground>(
|
: Selector<Settings, EntryBackground>(
|
||||||
selector: (context, s) => s.imageBackground,
|
selector: (context, s) => s.imageBackground,
|
||||||
builder: (context, background, child) {
|
builder: (context, background, child) {
|
||||||
final backgroundColor = background.isColor ? background.color : null;
|
// avoid background color filter or layer when the entry cannot be transparent
|
||||||
|
final backgroundColor = canHaveAlpha && background.isColor ? background.color : null;
|
||||||
|
|
||||||
if (background == EntryBackground.checkered) {
|
if (canHaveAlpha && background == EntryBackground.checkered) {
|
||||||
return LayoutBuilder(
|
return LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
final availableSize = constraints.biggest;
|
final availableSize = constraints.biggest;
|
||||||
|
|
Loading…
Reference in a new issue