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

bounds are ignored in renderer #223

Closed
brollb opened this issue Mar 14, 2016 · 0 comments
Closed

bounds are ignored in renderer #223

brollb opened this issue Mar 14, 2016 · 0 comments
Labels

Comments

@brollb
Copy link
Contributor

brollb commented Mar 14, 2016

When I create an engine with the following:

    // Create the netsblox env
    engine = Matter.Engine.create({
        render: {
            element: document.body,
            options: {
                width: 1800,
                height: 900
            },
            bounds: {
                min: {
                    x: -1000,
                    y: -1000
                },
                max: {
                    x: 1000,
                    y: 1000
                }
            }
        }
    });

The bounds seem to be ignored. Upon closer inspection, it looks like hasBounds is set to false by default (here) so the view is not updated in the world function.

This can be fixed by adding hasBounds to the options:

    // Create the netsblox env
    engine = Matter.Engine.create({
        render: {
            element: document.body,
            options: {
                width: 1800,
                height: 900,
                hasBounds: true
            },
            bounds: {
                min: {
                    x: -1000,
                    y: -1000
                },
                max: {
                    x: 1000,
                    y: 1000
                }
            }
        }
    });

but this should be automatically detected

brollb added a commit to brollb/matter-js that referenced this issue Mar 14, 2016
@liabru liabru added the bug label Mar 16, 2016
@liabru liabru closed this as completed in 053ea76 Apr 5, 2016
liabru added a commit that referenced this issue Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants