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

Shape::get_bound assumes 0,0 is inside the bounding box #19

Open
MaxVerevkin opened this issue Aug 17, 2023 · 0 comments
Open

Shape::get_bound assumes 0,0 is inside the bounding box #19

MaxVerevkin opened this issue Aug 17, 2023 · 0 comments

Comments

@MaxVerevkin
Copy link
Contributor

It uses

let mut bound = Bound::default();

as its initial bounding box, which contains all zeroes. If the shape does not contain the origin, this results in an incorrect box. The initial box should probably be something like

let mut bound = Bound {
    left: f64::INFINITY,
    bottom: f64::INFINITY,
    right: -f64::INFINITY,
    top: -f64::INFINITY,
};
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