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

Add aspectRatio constraint helper #254

Merged
merged 2 commits into from
Jul 26, 2022

Conversation

filipe-lemos
Copy link
Collaborator

Checklist

Motivation and Context

Some layouts are more easily achieved by defining a specific aspect
ratio for a view which, when combined with constraints to establish the
width or height of the view, allows Auto Layout to infer the size in
the other dimension.

Description

Add aspectRatio constraint helper through a new AspectRatioConstrainableProxy. This allows the creation of relative constraints between the width and height dimensions of a view.

Some layouts are more easily achieved by defining a specific aspect
ratio for a view which, when combined with constraints to establish the
width or height of the view, allows Auto Layout to infer the size in
the other dimension.
@filipe-lemos filipe-lemos self-assigned this Jul 25, 2022
@filipe-lemos filipe-lemos requested a review from a team July 25, 2022 17:23
@codecov
Copy link

codecov bot commented Jul 25, 2022

Codecov Report

Merging #254 (b0df56b) into master (e1699ce) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #254      +/-   ##
==========================================
+ Coverage   95.04%   95.05%   +0.01%     
==========================================
  Files         100      100              
  Lines        3367     3376       +9     
==========================================
+ Hits         3200     3209       +9     
  Misses        167      167              
Impacted Files Coverage Δ
Sources/AutoLayout/ConstrainableProxy.swift 98.10% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1699ce...b0df56b. Read the comment docs.

- Move `aspectRatio` to `SizeConstrainableProxy`
Copy link
Member

@p4checo p4checo left a comment

Choose a reason for hiding this comment

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

🚀

@filipe-lemos filipe-lemos merged commit 4a60eea into master Jul 26, 2022
@p4checo p4checo deleted the feature/constrain_aspect_ratio branch July 26, 2022 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants