Jump to content

WorldSpaceCanvas scaling, children don't appear to scale correctly


unintellisense
 Share

Recommended Posts

Hello,

I have a couple scenes where I scale up some WorldSpaceCanvas instances with some simple UI. I recently took the latest preview release and noticed that children are offset strangely until the canvas reaches its full scale. I made a PG which should demonstrate what I am talking about:

http://www.babylonjs-playground.com/#W9SZY#2

It's most obvious with the title, but it happens with anything which isn't very close to 0,0, it seems.

Thanks for a great framework!

Link to comment
Share on other sites

  • 2 weeks later...

Not sure whether I should create a brand new topic for this, so I apologize if I should have. 

I noticed with the latest preview, that the original PG (and my own project started getting the following error, it seems to occur anytime the scale is set to zero:

Uncaught Error: Can't invert matrix, near null determinant
    at Matrix2D.invertToRef (babylon.canvas2d.js:185)
    at Function.Matrix2D.Invert (babylon.canvas2d.js:144)
    at Rectangle2D.Prim2DBase.updateCachedStates (babylon.canvas2d.js:9136)
    at WorldSpaceCanvas2D.Prim2DBase.updateCachedStatesOf (babylon.canvas2d.js:8950)
    at WorldSpaceCanvas2D.Group2D._prepareGroupRender (babylon.canvas2d.js:11599)
    at WorldSpaceCanvas2D.Canvas2D._updateCanvasState (babylon.canvas2d.js:17734)
    at WorldSpaceCanvas2D.Canvas2D._render (babylon.canvas2d.js:17745)
    at e.callback (babylon.canvas2d.js:16554)
    at e.notifyObservers (babylon.js:2)
    at i.render (babylon.js:12)

 

If I change the initial scale to .001 or something, the error no longer occurs.

http://www.babylonjs-playground.com/#W9SZY#6

 

Other than that, really good! The various scaling / positioning I am doing on world as well as local canvas's are all working as expected. Great work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...