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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl Default for Matrix with an identity matrix #180

Merged
merged 1 commit into from Dec 20, 2018

Conversation

Projects
None yet
4 participants
@federicomenaquintero
Copy link
Contributor

federicomenaquintero commented Mar 25, 2018

In librsvg I have a big struct for which I could #[derive(Default)] if cairo::Matrix had impl Default. This would make my life easier 馃槃

gnomesysadmins pushed a commit to GNOME/librsvg that referenced this pull request Mar 25, 2018

Go back to a State::new() instead of deriving Default
Sigh, I am moving the affine field into the Rust State struct, but
cairo::Matrix doesn't impl Default.  So, do this by hand again.

See gtk-rs/cairo#180 for impl default fro Matrix
@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Mar 25, 2018

@federicomenaquintero Please add cairo-sys-rs = "0.6.0" to dependencies.

@GuillaumeGomez its was removed by last merge.

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Mar 25, 2018

Sorry, looked to crate branch, not to master. This need other solution.

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Mar 25, 2018

Maybe make cairo-rs version equal to published 0.4.1 will help

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

GuillaumeGomez commented Mar 25, 2018

Why has it been removed?

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Mar 25, 2018

@GuillaumeGomez you already fixed this week ago, i just forgot.
But strange why CI fails on nightly travis and apveyor

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

GuillaumeGomez commented Mar 25, 2018

That's quite strange. Why would there be a version conflict? :-/

impl Default for Matrix with an identity matrix
This is done here, rather than in cairo/src/matrices.rs, because of
the orphan rule - we can't implement Default for Matrix in that other
crate.

@federicomenaquintero federicomenaquintero force-pushed the federicomenaquintero:impl-default-for-matrix branch from b66a8bd to 43c4b95 Dec 19, 2018

@federicomenaquintero

This comment has been minimized.

Copy link
Contributor Author

federicomenaquintero commented Dec 19, 2018

I've updated the branch with a simpler implementation; it just initializes the matrix directly, rather than calling Cairo functions.

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

GuillaumeGomez commented Dec 19, 2018

馃憤

1 similar comment
@sdroege

This comment has been minimized.

Copy link
Member

sdroege commented Dec 19, 2018

馃憤

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Dec 19, 2018

@GuillaumeGomez GuillaumeGomez merged commit 76feceb into gtk-rs:master Dec 20, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
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
You can鈥檛 perform that action at this time.