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

Bump euclid dependency to 0.14.1. #1

Merged
merged 1 commit into from Jun 2, 2017
Merged

Bump euclid dependency to 0.14.1. #1

merged 1 commit into from Jun 2, 2017

Conversation

@nical
Copy link
Contributor

nical commented May 28, 2017

This is a very hipster type of pull request because euclid 0.14 isn't published yet on crates.io. But getting all of servo's use of euclid converted to 0.14 is going to be acrobatic, so I am getting started.

Since euclid 0.14 isn't published yet, you need to add

[replace]
"euclid:0.13.0" = { path = "path/to/a/local/clone/of/euclid" }

to Cargo.toml until 0.14 finds its way to crates.io.

No need to land this before that happens but I need to at least have this fixed up locally to start fixing webrender so I had to get started asap.

Since conversion to 0.14 is a lot of work (and a lot of crates), I only converted point to vectors where it seemed to make sense. There's probably some other more stylistic that could make sense (like using vec3 and other helpers), but I propose that we postpone that to followups.

Note that I added a comment somewhere in a place where we add two points to compute the origin of a line and I am not sure what this means, so this bit should be reviewed with special care.

Edit: got mixed up between 0.13 and 0.14

@Eijebong
Copy link
Member

Eijebong commented May 28, 2017

Now that euclid 0.13 is out, can this be merged ? I'm updating servo to euclid 0.13 and this is needed ^^

Edit: this PR is wrong, you took euclid master and not euclid 0.13 to test it (I think)

@nical
Copy link
Contributor Author

nical commented May 28, 2017

Now that euclid 0.13 is out, can this be merged ? I'm updating servo to euclid 0.13 and this is needed ^^

Actually I meant to say 0.14 but got mixed up. This PR updates plane-split after the massive point/vector refactoring in euclid (which isn't published on crates.io yet).

@Eijebong
Copy link
Member

Eijebong commented May 28, 2017

Ok then is it ok if I open a PR for the actual 0.13 ? :p

@nical nical changed the title Bump euclid dependency to 0.13. Bump euclid dependency to 0.14. May 28, 2017
@nical
Copy link
Contributor Author

nical commented May 28, 2017

Yep, no problem!

@nical nical force-pushed the nical:euclid-0-13 branch from 4e9427b to d3812b7 Jun 1, 2017
@nical nical changed the title Bump euclid dependency to 0.14. Bump euclid dependency to 0.14.1. Jun 1, 2017
@nical
Copy link
Contributor Author

nical commented Jun 1, 2017

r? @kvark

@nical nical force-pushed the nical:euclid-0-13 branch from d3812b7 to 17dddd8 Jun 1, 2017
Cargo.toml Outdated
@@ -10,6 +10,6 @@ documentation = "https://docs.rs/plane-split"

[dependencies]
binary-space-partition = "0.1.2"
euclid = "0.13"
euclid = "~0.14.1"

This comment has been minimized.

@kvark

kvark Jun 1, 2017

Member

isn't it equal to specifying just "0.14.1"?

This comment has been minimized.

@nical

nical Jun 1, 2017

Author Contributor

my understanding is that ~0.14.1 means "between 0.14.1 and 0.15 not included" whereas 0.14.1 means "specifically version 0.14.1".

This comment has been minimized.

@nical

nical Jun 1, 2017

Author Contributor

Oh! TIL.

@@ -160,7 +160,8 @@ impl<
let comp_y = intersect_across(a, b, axis_y);
// line that tries to intersect both
let line = Line {
origin: comp_x + comp_y,
// TODO(review): I don't understand the meaning of origin here

This comment has been minimized.

@kvark

kvark Jun 1, 2017

Member

so, comp_x is a point on the axis_x axis that is supposed to be between the polygons, and comp_y is the same for axis_y. Adding them is like adding X and Y projections of a vector.
What the code needs is a line that intersects both polygons, simple as that. Taking origin = comp_x + comp_y is not entirely correct here, it's a rough approximation (hence, the TODO at the top).

@nical nical force-pushed the nical:euclid-0-13 branch from 17dddd8 to 9aa6565 Jun 1, 2017
@nical
Copy link
Contributor Author

nical commented Jun 1, 2017

Woops, I'll convert the tests tomorrow.

@kvark
kvark approved these changes Jun 1, 2017
@nical nical force-pushed the nical:euclid-0-13 branch from 9aa6565 to b7a670b Jun 2, 2017
@nical nical force-pushed the nical:euclid-0-13 branch from b7a670b to d9c118e Jun 2, 2017
@kvark
Copy link
Member

kvark commented Jun 2, 2017

Thanks!
@bors-servo r+

@kvark kvark merged commit 5462f96 into servo:master Jun 2, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.