Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

Commit 4badc9d

Browse files
codeman7material-automation
authored andcommitted
#Buttons Fix clampToMinimumSize method.
PiperOrigin-RevId: 753390858
1 parent f7ef737 commit 4badc9d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

components/M3CButton/src/M3CButton.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,13 @@ - (void)setCapsuleCornersBasedOn:(CGSize)size {
610610
}
611611

612612
- (CGSize)clampToMinimumSize:(CGSize)size {
613-
if (size.height < _minimumHeight) {
614-
size.height = _minimumHeight;
613+
size.height = MAX(size.height, _minimumHeight);
614+
615+
if (_buttonSizeSet) {
616+
size.width = MAX(size.width, _minimumWidth);
617+
} else {
618+
size.width = MAX(MAX(size.height, size.width), _minimumWidth);
615619
}
616-
size.width = MAX(MAX(size.height, size.width), _minimumWidth);
617620
return size;
618621
}
619622
#pragma mark - Enabling multi-line layout

0 commit comments

Comments
 (0)