-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #243 - nical:angle, r=kvark
Use a dedicated Angle type for angles instead of Length<Rad>. This is the other breaking change that I want to sneak in @SimonSapin's bump. Length has proved quite unergonomic for angles. We don't have a good use case for storing angles in degrees (that would be evil), and there could be a lot useful specific methods for methods that apply for angles but not lengths. With a dedicated angle type we can write things like: ```rust mat.pre_rotate(Angle::radians(PI)); mat.pre_rotate(Angle::degrees(90.0)); ``` which deals with degrees in a nicer way (everything is always stored in radians but conversion to and from is easy). Also, with Angle we can implement `Angle<T> / Angle<T> = T` to compute ratios, multiply angles by these ratios, etc. I ran into the (lack of) ergonomics with `Length<Rad>` a lot in the SVG logic in lyon. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/euclid/243) <!-- Reviewable:end -->
- Loading branch information
Showing
6 changed files
with
165 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.