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

Fix u-turn direction #1647

Merged
merged 2 commits into from
Oct 3, 2018
Merged

Fix u-turn direction #1647

merged 2 commits into from
Oct 3, 2018

Conversation

frederoni
Copy link
Contributor

screenshot 2018-09-03 20 16 52

The arrow-180 asset used for u-turns in navigation-ui-resources is turning clockwise so we should flip it horizontally if it's right-hand rule of the road.

cc @akitchen @1ec5

@akitchen akitchen added this to the v0.23.0 milestone Oct 1, 2018
Copy link
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

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

Aside from the comment below, this change is significant enough (in a good way) to warrant a changelog entry.

@@ -69,3 +88,13 @@ class ManeuverViewTests: FBSnapshotTestCase {
// TODO: Figure out why the flip transformation do not render in a snapshot so we can test left turns and left side rule of the road.
}

extension UIView {

func asImage() -> UIImage {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider replacing this method with an initializer in a UIImage extension. That style is less “fluent” but also more consistent with the majority of the standard library.

Copy link
Contributor Author

@frederoni frederoni Oct 3, 2018

Choose a reason for hiding this comment

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

I agree but initializers on UIImage would require more steps and it's not particularly elegant since you can't return the instance. It would involve UIView->UIImage->CGImage(or any other type supported by UIImage->UIImage. So I went with a class function on UIImage instead, UIImage.from(_:).

@frederoni frederoni force-pushed the fred/fix-uturn branch 6 times, most recently from b45a90c to 4de17b6 Compare October 3, 2018 14:02
@frederoni frederoni merged commit 6dad274 into master Oct 3, 2018
@frederoni frederoni deleted the fred/fix-uturn branch October 3, 2018 14:18
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.

4 participants