Skip to content
Geometry primitives (basic linear algebra) for Rust
Rust
Branch: master
Clone or download
bors-servo Auto merge of #367 - fitzgen:less-restrictive-trait-bounds-for-transf…
…orm-2d-methods, r=nical

Allow building non-`Trig` transforms that don't rotate

The `Trig` trait bound is only required for doing rotations, and also `Trig` is only implemented for `f64` and `f32`. Putting the `Trig` trait bound on the main `impl` for `Transform2D` methods was a pretty restrictive and applied restrictions more often than was needed.

This commit moves the `Trig` trait bound to an `impl` specifically for rotation-related methods of `Transform2D`, and the result is that we can now scale or translate things represented with `i32` or `i64` or other non-`Trig` scalars.

<!-- 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/367)
<!-- Reviewable:end -->
Latest commit bd51fba Aug 11, 2019

README.md

You can’t perform that action at this time.