unintellisense Posted February 28, 2017 Share Posted February 28, 2017 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! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 28, 2017 Share Posted February 28, 2017 ping our Canvas2D guru: @Nockawa Quote Link to comment Share on other sites More sharing options...
Nockawa Posted February 28, 2017 Share Posted February 28, 2017 @unintellisense I'm working on it since few hours, it's about to be solved, the scale will work as expected. I'll let you know when the Source and PG is updated. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted February 28, 2017 Share Posted February 28, 2017 @unintellisense the PG is updated, please CTRL-F5 your browser and try again, tell me if the issue is fixed or not, thanks! Quote Link to comment Share on other sites More sharing options...
unintellisense Posted February 28, 2017 Author Share Posted February 28, 2017 You the man, PG works as expected, as well as my own project when I take latest. Thanks again! Nockawa 1 Quote Link to comment Share on other sites More sharing options...
Nockawa Posted February 28, 2017 Share Posted February 28, 2017 my pleasure! Quote Link to comment Share on other sites More sharing options...
unintellisense Posted March 11, 2017 Author Share Posted March 11, 2017 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. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted March 11, 2017 Share Posted March 11, 2017 well, I assume that if you set the scale to 0, now at some point there will be a division by zero... I should throw an exception if you try to set the scale to 0, it should not be authorized. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.