AlbertTJames

NaN produced by Prim2DBase._updateP_updatePositioning after dispose and recreate

Recommended Posts

Hi, 

So... my problem is a bit specific. I will try to reproduce it in the playgroud but I am not sure I will be able to. 

So I have a Rectangle2d that holds 4 rectangle2d children, the green background is the parent square and the children square are the 4 grey rectangles.

I am using the centering and margin system:

 I used to dispose of those rectangle children and recreate them at certain points in time, storing the newly created children in the same array replacing the hold ones.

The problem is that when I resize the window there is a call to Prim2DBase._updatePositioning that returns (NaN, NaN) as the _actualPosition (in the if (hasMargin) ... which they do). And it cause the parent and all its children to disappear from the screen. That's why i though it was linked to the bug @Wingnut mentionned yesterday.

 There are several variables that are NaN, one of them is Prim2d._size3... but i do not know why, nor do I see where it is define (I only see one definition that sets it to zero... I will look tonight into the typescript source to see if it is there...). This does not happen if I do not dispose of the children prim2d... 

 I had problems with Prim2d.dispose() before, and looking at it, I do not see where the prim2d is actually set to null. Maybe that is the problem? Some kind of persistant reference that interferes with the computation of the rectangles.

 

I will look more into it, but if it is something people have encountered I am interested to know their thoughts.

@Nockawa <3 

For now I am not disposing of the prims anymore :D 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.