Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mob][photos] Fix clipping issue of people in all people screen #4880

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 45 additions & 48 deletions mobile/lib/ui/viewer/search_tab/people_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ class SearchExampleRow extends StatelessWidget {
class PersonSearchExample extends StatelessWidget {
final SearchResult searchResult;
final double size;

const PersonSearchExample({
super.key,
required this.searchResult,
Expand All @@ -196,6 +197,8 @@ class PersonSearchExample extends StatelessWidget {

@override
Widget build(BuildContext context) {
final borderRadius = 82 * (size / 102);

final bool isCluster = (searchResult.type() == ResultType.faces &&
int.tryParse(searchResult.name()) != null);

Expand All @@ -217,60 +220,54 @@ class PersonSearchExample extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
ClipPath(
clipper: ShapeBorderClipper(
shape: ContinuousRectangleBorder(
borderRadius: BorderRadius.circular(82),
),
),
child: Stack(
clipBehavior: Clip.none,
alignment: Alignment.center,
children: [
ClipPath(
clipper: ShapeBorderClipper(
shape: ContinuousRectangleBorder(
borderRadius: BorderRadius.circular(82),
),
Stack(
clipBehavior: Clip.none,
alignment: Alignment.center,
children: [
ClipPath(
clipper: ShapeBorderClipper(
shape: ContinuousRectangleBorder(
borderRadius: BorderRadius.circular(borderRadius),
),
child: Container(
width: size,
height: size,
decoration: BoxDecoration(
color: getEnteColorScheme(context).strokeFaint,
),
),
child: Container(
width: size,
height: size,
decoration: BoxDecoration(
color: getEnteColorScheme(context).strokeFaint,
),
),
SizedBox(
width: size - 2,
height: size - 2,
child: searchResult.previewThumbnail() != null
? ClipPath(
clipper: ShapeBorderClipper(
shape: ContinuousRectangleBorder(
borderRadius: BorderRadius.circular(81),
),
),
child: searchResult.type() != ResultType.faces
? ThumbnailWidget(
searchResult.previewThumbnail()!,
shouldShowSyncStatus: false,
)
: FaceSearchResult(searchResult),
)
: ClipPath(
clipper: ShapeBorderClipper(
shape: ContinuousRectangleBorder(
borderRadius: BorderRadius.circular(81),
),
),
SizedBox(
width: size - 2,
height: size - 2,
child: searchResult.previewThumbnail() != null
? ClipPath(
clipper: ShapeBorderClipper(
shape: ContinuousRectangleBorder(
borderRadius:
BorderRadius.circular(borderRadius - 1),
),
child: const NoThumbnailWidget(
addBorder: false,
),
child: searchResult.type() != ResultType.faces
? ThumbnailWidget(
searchResult.previewThumbnail()!,
shouldShowSyncStatus: false,
)
: FaceSearchResult(searchResult),
)
: ClipPath(
clipper: ShapeBorderClipper(
shape: ContinuousRectangleBorder(
borderRadius: BorderRadius.circular(81),
),
),
),
],
),
child: const NoThumbnailWidget(
addBorder: false,
),
),
),
],
),
isCluster
? GestureDetector(
Expand Down
Loading