Skip to content

Commit 006d690

Browse files
square-tombstudioclaude
committed
perf(mobile): keep ClipOval for person avatar clips
People avatars are the densest widget in scroll lists; keep the dedicated oval clip instead of a general ClipPath. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost> Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tom Brow <[email protected]>
1 parent 749ec3a commit 006d690

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎mobile/lib/shared/widgets/avatar_shape.dart‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ class AvatarClip extends StatelessWidget {
2626
final Widget child;
2727

2828
@override
29-
Widget build(BuildContext context) => ClipPath(
30-
clipper: ShapeBorderClipper(shape: avatarShape(isAgent: isAgent)),
31-
child: child,
32-
);
29+
Widget build(BuildContext context) => isAgent
30+
? ClipPath(
31+
clipper: ShapeBorderClipper(shape: avatarShape(isAgent: true)),
32+
child: child,
33+
)
34+
// People keep the dedicated oval clip, the fast path in dense lists.
35+
: ClipOval(child: child);
3336
}
3437

3538
Path _agentSquirclePath(Rect rect) {

0 commit comments

Comments
 (0)