• LongCatIsLooong's avatar
    Ensure Icon vertically centers its icon glyph. (#138937) · f2b74725
    LongCatIsLooong authored
    Fixes https://github.com/flutter/flutter/issues/138592. 
    
    In an `Icon` widget if the icon font's body (ascender + descender) is larger than the font's units per em, the icon height reported by the text layout library will be larger than the specified font size. When that happens the icon glyph gets pushed towards the bottom because the `Icon` widget is wrapped in a fontSize x fontSize SizedBox and thus has a fixed height of fontSize px. This wasn't a problem for material icons because its UPEM == body.
    f2b74725
icon.dart 12 KB