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

Possible bug in BBox util struct #91

Open
clogwog opened this issue Apr 3, 2024 · 1 comment
Open

Possible bug in BBox util struct #91

clogwog opened this issue Apr 3, 2024 · 1 comment

Comments

@clogwog
Copy link

clogwog commented Apr 3, 2024

Doesn't
float center_y() { return right + height() / 2; }
look wrong ?

I'd expect it to be something like:
float center_y() { return top + height() / 2; }

typedef struct {
    float left;
    float top;
    float right;
    float bottom;

    float width() { return right - left; }
    float height() { return bottom - top; }
    float center_x() { return left + width() / 2; }
    float center_y() { return right + height() / 2; }
}BBox;

From :

float center_y() { return right + height() / 2; }

@clogwog
Copy link
Author

clogwog commented Apr 3, 2024

created PR
#92

@clogwog clogwog changed the title Possible bug in BBox util class Possible bug in BBox util struct Apr 3, 2024
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