Skip to content
This repository has been archived by the owner on Nov 14, 2018. It is now read-only.

New Canvas extensions #17

Merged
merged 4 commits into from
Dec 19, 2017
Merged

New Canvas extensions #17

merged 4 commits into from
Dec 19, 2017

Conversation

romainguy
Copy link
Collaborator

Adds the following extensions to Canvas:

  • withTranslation
  • withRotation
  • withScale
  • withSkew

Each is equivalent to:

val count = canvas.save()
try {
canvas.translate(…) // rotate, etc.
} finally {
canvas.restoreToCount(count)
}

Adds the following extensions to Canvas:
- withTranslation
- withRotation
- withScale
- withSkew

Each is equivalent to:

val count = canvas.save()
try {
    canvas.translate(…) // rotate, etc.
} finally {
    canvas.restoreToCount(count)
}
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot. The email used to register you as an authorized contributor must be the email used for the Git commit.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@romainguy
Copy link
Collaborator Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

* Wrap the specified `block` in calls to [Canvas.save]/[Canvas.rotate]
* and [Canvas.restoreToCount].
*/
inline fun Canvas.withRotation(degrees: Float = 0.0f, pivotX: Float = 0.0f, pivotY: Float = 0.0f,
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the params be one-per-line?

Copy link
Contributor

Choose a reason for hiding this comment

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

ktlint isn't enforcing this correctly yet: pinterest/ktlint#130

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yuck. But I'll change it

@@ -0,0 +1,77 @@
/*
* CopivotYright (C) 2017 The Android Open Source Project
Copy link
Contributor

Choose a reason for hiding this comment

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

Co-what-now? Errant find/replace?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey, good catch :)

@romainguy romainguy merged commit a7d21cc into master Dec 19, 2017
@romainguy romainguy deleted the canvas-ext branch December 19, 2017 19:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants