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

text_system split #7779

Merged
merged 48 commits into from
Apr 17, 2023
Merged

text_system split #7779

merged 48 commits into from
Apr 17, 2023

Commits on Feb 17, 2023

  1. changes:

    * Added a new trait `MeasureNode`.
    * Added new structs `ImageMeasure` and `BasicMeasure` that implement `MeasureNode`.
    * Add a field to `CalculatedSize` called `measure` that takes a boxed `MeasureNode`.
    * `upsert_leaf` uses the `measure` of `CalculatedSize` to create a `MeasureFunc` for the node.
    ickshonpe committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    3a09af9 View commit details
    Browse the repository at this point in the history
  2. cargo fmt

    ickshonpe committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    b1712b8 View commit details
    Browse the repository at this point in the history
  3. fix lints

    ickshonpe committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    080aae7 View commit details
    Browse the repository at this point in the history
  4. cargo fmt

    ickshonpe committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    9c4c01d View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2023

  1. impl Measure for Fn

    ickshonpe committed Feb 18, 2023
    Configuration menu
    Copy the full SHA
    8934a6f View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2023

  1. Changes:

        * Added the `TextLayoutInfo` component to `TextBundle`.
        * Added the `TextLayoutInfo` component to `Text2dBundle`.
        * Changed `TextLayoutInfo` queries to be non-optional.
    ickshonpe committed Feb 19, 2023
    Configuration menu
    Copy the full SHA
    fc9b2d9 View commit details
    Browse the repository at this point in the history
  2. cargo fmt --all

    ickshonpe committed Feb 19, 2023
    Configuration menu
    Copy the full SHA
    f7d20ea View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2023

  1. Configuration menu
    Copy the full SHA
    13091a3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cfdb649 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    621a117 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3981c7f View commit details
    Browse the repository at this point in the history
  5. changes:

    * Renamed `CalculatedSize` to `IntrinsicSize`. It is now non-copy. Added a field `measure` and removed `preserve_aspect_ratio`.
    * Added `measurement` module to `bevy_ui`
    * Added `Measure` trait. A `Measure` is used to compute the size of an intrisically sized node.
    * Added `ImageMeasure` and `FixedMeasure` `Measure` implementations.
    * Changed `update_image_calculated_size_system` to use `ImageMeasure`.
    * Changed `upsert_leaf` to use the `Measure` of `CalculatedSize` for the `MeasureFunc` of intrinsically sized nodes.
    ickshonpe committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    b004072 View commit details
    Browse the repository at this point in the history
  6. changes:

    * Added the system (dummy atm) `measure_text_system`
    * Changed the system execution order so that `measure_text_system` replaces `text_system` in the order.
    `text_system` now runs after `UiSystem::Flex`.
    
    Previously the `text_system` ran before the layout was calculated and the size of the text node was determined,
    so it couldn't shape the text correctly to fit the layout, and had no way of determining if the text needed to be wrapped.
    There was a hack, the system `text_constraint` that tried to determine the size of the node from the local size constraints of the node in its `Style` component.
    This could not work correctly, `Val::Percent` constraints just had to be ignored as they are calcualted from size of the parent node and the `Val::Px` constraints are just a guess,
    without computing the rest of the layout.
    Also because the `text_system` queried for changes to the `Style` component, and not the `Node` component, it couldn't react to changes in the layout correctly.
    The layout system then wouldn't recieve all the information it would need to fit the text node correctly, such as the `max-content` and `min-content` sizes.
    ickshonpe committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    af7b6f2 View commit details
    Browse the repository at this point in the history
  7. changes:

    * implemented the `measure_text_system` function.
    * Added the `TextMeasure` type that implements measure.
    * Added the `TextQueue` resource struct.
    * Added methods to the `TextPipeline` to get min and max content sizes for the text.
    ickshonpe committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    2280bb0 View commit details
    Browse the repository at this point in the history
  8. Clean up and bug fixes.

    changes:
    * Removed `TextQueue`
    * Added `min_content`, `max_content` and `ideal` fields to IntrinsicSize.
    * Added `ideal_height` field to `TextMeasure`.
    * Fixed text system queueing and change detection issues. `measure_text_system` only queries for modified `Text`,
    `text_system` queuries for `Text` or `Node` changes.
    ickshonpe committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    f510899 View commit details
    Browse the repository at this point in the history
  9. simplified text size code

    ickshonpe committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    95d7c96 View commit details
    Browse the repository at this point in the history
  10. fix derivable impls

    ickshonpe committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    91a05d2 View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2023

  1. Configuration menu
    Copy the full SHA
    1ee6233 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2023

  1. Configuration menu
    Copy the full SHA
    5944e4b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    540f51e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ac267a9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    70f5422 View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2023

  1. Configuration menu
    Copy the full SHA
    1fe7ac7 View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2023

  1. Configuration menu
    Copy the full SHA
    d919ac7 View commit details
    Browse the repository at this point in the history
  2. Cleaned up unused code and fields.

    Renamed `size` field of `CalculatedSize` to `previous_size`.
    ickshonpe committed Mar 21, 2023
    Configuration menu
    Copy the full SHA
    8a4c73d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5ae0d4d View commit details
    Browse the repository at this point in the history
  4. cargo fmt --all

    ickshonpe committed Mar 21, 2023
    Configuration menu
    Copy the full SHA
    711036b View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2023

  1. Configuration menu
    Copy the full SHA
    74afca0 View commit details
    Browse the repository at this point in the history
  2. changes:

    * rewrote text measurefunc
    * text bounds for min and max content widths are precomputed
    ickshonpe committed Mar 31, 2023
    Configuration menu
    Copy the full SHA
    941c018 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    89eb505 View commit details
    Browse the repository at this point in the history
  4. removed some unused code

    ickshonpe committed Mar 31, 2023
    Configuration menu
    Copy the full SHA
    ffb59a8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cbb1d17 View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2023

  1. changes:

    * Removed the `previous_size` field from `CalculatedSize` and replaced it with the component `UiImageSize`. The only purpose of the `previous_size` component of `CalculatedSize` was for image size change detection. It makes much more sense to store the image size directly in its own component and it enables users to query the size of a node's image if they need to.
    * Added the `UiImageSize` component to `ImageBundle`.
    ickshonpe committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    8547ce2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    76ea8a0 View commit details
    Browse the repository at this point in the history
  3. formatting

    ickshonpe committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    6c15af9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    08aa11c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    410a4ec View commit details
    Browse the repository at this point in the history
  6. fix misnamed variable

    ickshonpe committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    a04e100 View commit details
    Browse the repository at this point in the history
  7. fix misnamed variables

    ickshonpe committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    af1f990 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    10e2ddc View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ee1d1f3 View commit details
    Browse the repository at this point in the history
  10. fixed extra space

    ickshonpe committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    8f1eb15 View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2023

  1. Update crates/bevy_ui/src/widget/image.rs

    Co-authored-by: François <[email protected]>
    ickshonpe and mockersf authored Apr 15, 2023
    Configuration menu
    Copy the full SHA
    2ec10d8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    be4053c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7526fc6 View commit details
    Browse the repository at this point in the history
  4. Update crates/bevy_text/src/pipeline.rs

    Co-authored-by: François <[email protected]>
    ickshonpe and mockersf authored Apr 15, 2023
    Configuration menu
    Copy the full SHA
    e33bc19 View commit details
    Browse the repository at this point in the history
  5. fixed needless borrow

    ickshonpe committed Apr 15, 2023
    Configuration menu
    Copy the full SHA
    68c6e98 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2779750 View commit details
    Browse the repository at this point in the history