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

Duplicating shapes is difficult #1

Closed
traviskirton opened this issue Mar 29, 2012 · 4 comments
Closed

Duplicating shapes is difficult #1

traviskirton opened this issue Mar 29, 2012 · 4 comments

Comments

@traviskirton
Copy link
Collaborator

There should be an easy way to duplicate a shape, or create a new shape which is a copy of another shape.

@traviskirton
Copy link
Collaborator Author

this will be a bit tricky, because there is no initWithLayer, or initWithBezierPath to copy over the contents of the originating shape's C4ShapeLayer

@traviskirton
Copy link
Collaborator Author

initWithLayer won't work because self.layer is immutable.

@traviskirton
Copy link
Collaborator Author

i think i will add a path property to shapes... funny to do this, because it challenges the methods: [C4Shape ellipse:], [C4Shape rect:], etc... but i think it will work, and won't be such a bad thing...

@traviskirton
Copy link
Collaborator Author

Fixed. You can now copy shapes.

C4Shape *copiedShape = [anotherShape copy];

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

No branches or pull requests

1 participant