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

Bounding rectangle doesn't fit all device types #31

Open
kylenahas opened this issue Aug 17, 2020 · 1 comment
Open

Bounding rectangle doesn't fit all device types #31

kylenahas opened this issue Aug 17, 2020 · 1 comment

Comments

@kylenahas
Copy link
Collaborator

As pointed out by Avery on the Google Groups feedback thread, devices are clipped improperly when the playfield window is not active.

image

I believe the following code to be at fault:

    def boundingRect(self):
        return QRectF(self.device_size / -2, self.device_size / -2,
                      self.device_size, self.device_size)

➔ playfield.py

@atummons
Copy link
Contributor

I agree. I had something kind of working, but it wasn't what I wanted. Setting a bouncing rect is exactly that...a rectangle. So a triangle shape has a clickable area that of a rectangle. That is a bit of an issue there, but that might just be a limitation.

Further when you start changing angles, the rectangle angle doesn't adjust. So you have to import cos and sin to find a bounding rect. We would really want something like this: https://www.mathopenref.com/coordbounds.html where explicit coordinates are given relative to the center point. I will do some more digging on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants