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

Expose baseline on TextLayout, add Baseline alignment to Flex #1295

Merged
merged 1 commit into from
Oct 13, 2020

Commits on Oct 13, 2020

  1. Expose baseline on TextLayout, add Baseline alignment to Flex

    This introduces the idea of baseline alignment as a component
    of layout.
    
    During their `layout` calls, widgets can specify their baseline_offset,
    which is the distance from the bottom of their reported size to their
    baseline.
    
    Generally, the baseline will be derived from some text object,
    although widgets that do not contain text but which appear next
    to widgets that do can specify an arbitrary baseline.
    
    This also adds CrossAxisAlignment::Baseline to Flex; this is
    only meaningful in a Flex::row, in which case it aligns all of
    its children based on their own reported baselines.
    
    The best place to play around with this code is in examples/flex.rs.
    cmyr committed Oct 13, 2020
    Configuration menu
    Copy the full SHA
    2230b23 View commit details
    Browse the repository at this point in the history