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

Implement Default trait for vectors #979

Merged
merged 1 commit into from
Feb 10, 2023
Merged

Implement Default trait for vectors #979

merged 1 commit into from
Feb 10, 2023

Conversation

yuraiz
Copy link
Contributor

@yuraiz yuraiz commented Feb 10, 2023

I made a gtk widget that uses graphene::Vec3 internally,
https://github.com/yuraiz/telegrand/blob/animated-background/src/session/content/gradient_bg.rs
and because vectors doesn't implement Default I can't derive Default for widget implementation

also it would be useful to have gdk::RGBA to vector conversions but that's compicated because those libraries are independent

sdroege
sdroege previously approved these changes Feb 10, 2023
Copy link
Member

@sdroege sdroege left a comment

Choose a reason for hiding this comment

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

Probably makes sense to also implement that for the Points the same way, and for the Matrix as the identity matrix.

Do you want to add those?

@sdroege sdroege added the needs-backport PR needs backporting to the current stable branch label Feb 10, 2023
@yuraiz
Copy link
Contributor Author

yuraiz commented Feb 10, 2023

Probably makes sense to also implement that for the Points the same way, and for the Matrix as the identity matrix.

Do you want to add those?

Yes

@yuraiz
Copy link
Contributor Author

yuraiz commented Feb 10, 2023

I found that vectors have zero() fn, it's better to use it

@yuraiz yuraiz requested a review from sdroege February 10, 2023 19:11
graphene/src/matrix.rs Outdated Show resolved Hide resolved
@yuraiz yuraiz requested a review from sdroege February 10, 2023 19:41
@sdroege sdroege merged commit 864702e into gtk-rs:master Feb 10, 2023
@yuraiz yuraiz deleted the default-vectors branch February 10, 2023 20:19
@pbor pbor added backported PR was backported to the current stable branch and removed needs-backport PR needs backporting to the current stable branch labels Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported PR was backported to the current stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants