Commit 19d0500
committed
[Button] Fix icon position with multiline text
When the icon gravity is textTop, we are using the smaller one of the calculated height from text paint and the text layout height to decide the icon position. This is wrong when there are multiple lines of text since the text paint is always single line and always shorter than the actual height.
Fixes this by returning the actual layout height whenever there are multiple lines of text to fix the issue.
Resolves #2619
PiperOrigin-RevId: 4409237331 parent dc0d8a9 commit 19d0500
File tree
1 file changed
+17
-9
lines changed- lib/java/com/google/android/material/button
1 file changed
+17
-9
lines changedLines changed: 17 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
593 | 595 | | |
594 | 596 | | |
595 | 597 | | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
603 | 607 | | |
604 | 608 | | |
605 | 609 | | |
| |||
617 | 621 | | |
618 | 622 | | |
619 | 623 | | |
620 | | - | |
| 624 | + | |
621 | 625 | | |
622 | 626 | | |
623 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
624 | 632 | | |
625 | 633 | | |
626 | 634 | | |
| |||
632 | 640 | | |
633 | 641 | | |
634 | 642 | | |
635 | | - | |
| 643 | + | |
636 | 644 | | |
637 | 645 | | |
638 | 646 | | |
| |||
0 commit comments