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

Define bounds on both circle and rect for use with interfaces #30

Open
duysqubix opened this issue Oct 10, 2023 · 0 comments
Open

Define bounds on both circle and rect for use with interfaces #30

duysqubix opened this issue Oct 10, 2023 · 0 comments

Comments

@duysqubix
Copy link
Contributor

In my project I have a basic Shape interface defined as

type Shape interface {
	Area() float64
	Bounds() pixel.Rect
	Contains(point pixel.Vec) bool
}

It would be super useful if the pixel shapes matched this interface. Rect of course would just return itself.

Working on a physics engine built on top of pixel (🤫), and I'm trying to keep to native pixel structs as much as possible. This would give me a lot of flexibility in working with them.

Not sure if it makes sense to add the interface itself to pixel or not, but I would certainly use it.

Original issue: faiface/pixel#316

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