Skip to content

Taffy 0.8 - Allow retrieving underlying size from tagged pointer. #824

@PPakalns

Description

@PPakalns

What problem does this solve or what need does it fill?

Taffy 0.8 now uses tagged ptr:

The representation of many "size" types is now a tagged pointer than an enum. This is to enable calc().
The effected types are LengthPercentage, LengthPercentageAuto, Dimension, MinTrackSizingFunction, and
MaxTrackSizingFunction types.

To make integrations like egui_taffy to work, taffy::Style inspection sometimes is necessary and stored style parameters must be read and based on them decision are made.

Support retrieving original value from tagged ptr.

What solution would you like?

For example -> LengthPercentage could return LengthPercentageEnum which would contain only Length, Percentage cases.

We can assume that this will be used for simple use cases where value can not contain ptr, but just raw values. If value contains ptr, then program can panic.

What alternative(s) have you considered?

Currently do not have useful ideas for alternatives.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions