Skip to content

Commit f5bf411

Browse files
mohnjilesclaude
andcommitted
Card image: blur-fill behind a uniform-fit foreground
Portrait source images were getting cropped by UniformToFill (chins / hands cut off), but switching to Uniform would letterbox wide images in the otherwise-square card slot. Add a two-layer pattern: the same image at UniformToFill with a BlurEffect fills the slot edge-to-edge behind a Uniform foreground that always shows the full image. No crop, no empty bars — the blurred edges feel like a natural extension of the picture. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 34c054b commit f5bf411

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

StabilityMatrix.Avalonia/Views/CivArchiveBrowserPage.axaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,26 @@
134134
</LayoutTransformControl.LayoutTransform>
135135
<Grid Width="330" RowDefinitions="300,Auto">
136136
<Grid ClipToBounds="True">
137+
<!--
138+
Two-layer blur-fill so portrait images aren't cropped (Uniform on the
139+
foreground keeps the whole image visible) but we don't get letterbox
140+
bars either (the same image, blurred and UniformToFilled, fills the
141+
leftover space behind it).
142+
-->
137143
<controls:BetterAdvancedImage
138144
CornerRadius="8"
139145
IsVisible="{Binding ImageUrl, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
140146
Source="{Binding ImageUrl}"
141-
Stretch="UniformToFill" />
147+
Stretch="UniformToFill">
148+
<controls:BetterAdvancedImage.Effect>
149+
<BlurEffect Radius="24" />
150+
</controls:BetterAdvancedImage.Effect>
151+
</controls:BetterAdvancedImage>
152+
<controls:BetterAdvancedImage
153+
CornerRadius="8"
154+
IsVisible="{Binding ImageUrl, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
155+
Source="{Binding ImageUrl}"
156+
Stretch="Uniform" />
142157

143158
<!-- Placeholder when no image -->
144159
<Border Background="{DynamicResource ControlAltFillColorSecondaryBrush}" IsVisible="{Binding ImageUrl, Converter={x:Static StringConverters.IsNullOrEmpty}}">

0 commit comments

Comments
 (0)