Skip to content

Conversation

@luanpotter
Copy link
Contributor

As a follow-up of #349, we might want to support leftTranslateByVector2, for the same reasons.

Note: there were no tests that I could find for the other broken down methods, so I added some assertions. Please let me know if they should be somewhere else or if we want more exhaustive tests.

Note: I am not implementing an equivalent for the scale method because the default implementation of falling back y and z to x felt less intuitive when using a Vector2. It would mean that scaling by a Vector2 v would be equivalent to scale by v.x, v.y, v.x, 1.0, which isn't quite as clear as the translation case. But I'd be happy to add the helper if desired.

@luanpotter luanpotter force-pushed the luan.leftTranslateByVector2 branch from 0568f24 to bdb9df7 Compare November 14, 2025 19:58
@luanpotter
Copy link
Contributor Author

@kevmoo updated this one with rebase + changelog entry 🙇

@kevmoo
Copy link
Collaborator

kevmoo commented Nov 14, 2025

Would you include more details? I don't know what "left" means here.

@coveralls
Copy link

coveralls commented Nov 14, 2025

Coverage Status

coverage: 26.875% (+0.2%) from 26.708%
when pulling 3cef762 on luanpotter:luan.leftTranslateByVector2
into ee9f14d on google:master.

@luanpotter
Copy link
Contributor Author

@kevmoo this is mostly for consistent with the existing leftTranslate series of methods, so they match the (right) translate.
The direction here is whether this matrix is multiplied from the left or from the right with the resulting translation matrix, which can have different results. I added a bit more detail to the changelog, please let me know if you want me to elaborate more (but this is in line with how all the existing methods are named and described in the docs).

@luanpotter
Copy link
Contributor Author

This is also parallel to #354 btw

Copy link
Collaborator

@kevmoo kevmoo left a comment

Choose a reason for hiding this comment

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

Just a bit of cleanup to the changelog and we can land this.

Co-authored-by: Kevin Moore <[email protected]>
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