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

Setting position causes "TypeError: Cannot read property 'length' of undefined". #263

Closed
duckmaestro opened this issue Jul 26, 2013 · 0 comments

Comments

@duckmaestro
Copy link
Contributor

The following simple code causes a type error while executing the last line (.position = ...):

        var canvas = document.getElementById("mainCanvas");                
        paper.setup(canvas);

        var inspector = new paper.Group();
        var clip = paper.Shape.Rectangle(new paper.Point(0, 0), new paper.Size(200, 200));
        inspector.addChild(clip);
        clip.clipMask = true;

        var background = paper.Shape.Rectangle(new paper.Point(0, 0), new paper.Size(200, 200));
        inspector.addChild(background);
        background.fillColor = new paper.Color(1, 1, 1, 1);
        background.strokeColor = new paper.Color(0.5, 0.5, 0.5, 1);
        background.strokeWidth = 1;

        inspector.position = new paper.Point(300, 300);

I've tried both v0.9.8 as well as the latest nightly (v0.9.9), and have tried both Chrome and Awesomium. I've also tried new paper.Shape.Rectangle(...) instead of just paper.Shape.Rectangle(...).

The call stack (on v0.9.8) that I get is:

TypeError: Cannot read property 'length' of undefined
    at Shape.Base.extend.isEmpty (paper.js:2790:24)
    at Group.Base.extend.Base.each._getBounds (paper.js:2857:33)
    at Group.Base.extend.Base.each._getCachedBounds (paper.js:2825:21)
    at Group.Base.extend.Base.each.(anonymous function) (paper.js:2796:19)
    at Group.Base.extend.getPosition (paper.js:2771:31)
    at Group.Base.extend.setPosition (paper.js:2777:54)
    at window.onload (index2.html:94:36)
lehni added a commit that referenced this issue Aug 9, 2013
Fix to #263: _children undefined inside call to myShape.isEmpty().
@lehni lehni closed this as completed Aug 9, 2013
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

2 participants