Skip to content

Possible bug in BBox util struct #91

@clogwog

Description

@clogwog

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; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions