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

debug draw bounding boxes are not properly aligned for child actors #505

Closed
jedeen opened this issue Aug 19, 2015 · 6 comments · Fixed by #645
Closed

debug draw bounding boxes are not properly aligned for child actors #505

jedeen opened this issue Aug 19, 2015 · 6 comments · Fixed by #645
Assignees
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior
Milestone

Comments

@jedeen
Copy link
Member

jedeen commented Aug 19, 2015

In the image below, the red square is a child actor of the white square.
image

@jedeen jedeen added bug This issue describes undesirable, incorrect, or unexpected behavior on-deck labels Aug 19, 2015
@jedeen jedeen added this to the vNext milestone Aug 19, 2015
@jedeen jedeen modified the milestones: vNext, 0.7.1 Release Mar 12, 2016
@jedeen jedeen removed the on-deck label Mar 13, 2016
@kamranayub
Copy link
Member

Is this a visual test (and if so which one)?

@kamranayub kamranayub self-assigned this Sep 2, 2016
@eonarheim
Copy link
Member

I don't think it has one, the coordinate test might be good to use for this issue

@kamranayub
Copy link
Member

Oh sure, yeah I can test it. I have a feeling this is fixed.

On Fri, Sep 2, 2016, 16:33 Erik Onarheim notifications@github.com wrote:

I don't think it has one, the coordinate test might be good to use for
this issue


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#505 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAiaa7eTAc6YgYHA1ihHA7bSxedqlpYrks5qmJZAgaJpZM4FuChq
.

@kamranayub
Copy link
Member

Coordinates test is too small, I've created a new visual debug test which shows the issue clearly:

image

@kamranayub
Copy link
Member

The issue is simply that we fixed child actor world coords, and the debug draw was trying to compensate from previous poor world coordinate calculation.

@kamranayub
Copy link
Member

Actually, it was worse--getHeight() and getWidth() did not take into account parent scaling (getGlobalScale()). I've fixed it and magically now everything works 👍

eonarheim pushed a commit that referenced this issue Sep 4, 2016
Closes #505

![image](https://cloud.githubusercontent.com/assets/563819/18231954/a6ffd300-728a-11e6-8f9c-43f49a304059.png)


## Context

Child actors were not properly taking into account parent(s) scale when calculating their world width and height, so the bounding boxes and unit circle were not properly scaled/drawn.

Debug draw was compensating for previous world coord calculation (that has been fixed), so removed the canvas context transformations.

## Changes:

- Fix `Actor.getWidth()` and `Actor.getHeight()` to take into account global scale
- Fix debug drawing to work properly
- Add unit test coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior
Projects
None yet
3 participants