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

items is twice to much for images #29

Open
clankill3r opened this issue Feb 24, 2015 · 2 comments
Open

items is twice to much for images #29

clankill3r opened this issue Feb 24, 2015 · 2 comments

Comments

@clankill3r
Copy link

If I place rectangles for example it's fine.
If I place images i always have twice as much.

    var items = b.items(b.layer("s_images"));
    b.println("items.length: "+items.length);

I think it both reports the content and the frame.

@ff6347 ff6347 added the bug label Jul 6, 2016
@ff6347
Copy link
Member

ff6347 commented Jul 6, 2016

You are right. It is counting the image as well.

var items = b.items(b.layer("img"));
b.println("b.items: "+items.length);
b.println("pageItems: " + (b.doc()).layers.item("img").pageItems.length);
b.println("allPageItems: " + (b.doc()).layers.item("img").allPageItems.length);

returns:

b.items: 4
pageItems: 3
allPageItems: 4

In includes/structure.js line 216 we are using. allPageItems. This should be pageItems. We will have to test if a change would affect other parts where b.items is used.

Possible problmes could exist in:

@ff6347 ff6347 modified the milestone: Close all those bugs! Jul 6, 2016
@trych
Copy link
Contributor

trych commented Jul 24, 2016

I don't think it should cause any problems to switch to pageItems. With b.ungroup() it is currently returning allPageItems, I am not sure if this is really the desired behavior (as only the top level pageItems were really grouped). We just should update the docs to tell the user that with b.items() only the top level items are treated.

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

3 participants