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

ConstrainedAspectRatio element #23

Merged
merged 3 commits into from Nov 8, 2019
Merged

Conversation

watt
Copy link
Collaborator

@watt watt commented Oct 10, 2019

A new ConstrainedAspectRatio element that constrains the size of its child to — you guessed it — an aspect ratio.

You can choose to enforce this constraint by expanding or shrinking the child. Open to alternative suggestions for the name of "expand or shrink" behavior.

@@ -0,0 +1,77 @@
/// Constrains the size of the content element to an aspect ratio.
public struct ConstrainedAspectRatio: Element {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: Don't love this name but don't have a better suggestion right now.

public struct ConstrainedAspectRatio: Element {
/// Represents whether the content element's size should be expanded to fill its parent
/// or shrunk to fit it.
public enum ContentMode {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesnt matter within Blueprint, but I tend to make these enums equatable when I can.

@watt watt force-pushed the watt/constrained-aspect-ratio branch from 076b8d9 to 09e1463 Compare November 7, 2019 23:57
@watt watt merged commit eccf463 into master Nov 8, 2019
@watt watt deleted the watt/constrained-aspect-ratio branch November 8, 2019 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants