IjzerenHein / famous-autolayout

Apple's Auto Layout and Visual Format language for famo.us
MIT License
55 stars 2 forks source link

Why is subview width a negative value? #3

Open trusktr opened 5 years ago

trusktr commented 5 years ago

I've been working on #2. I haven't changed any of your logic, the only difference is that I'm applying the view dimensions to my own nodes instead of famous nodes. But otherwise, all logic is identical.

Any ideas why the width of one subview is coming negative? This throws my size calculations bonkers. I could probably guard my renderables against it by clamping to 0, but I'm just curious why subView.width may be a negative value.

Basically here:

https://github.com/IjzerenHein/famous-autolayout/blob/e4cef730240a0e02c362aff918c4c6a59e151e7e/src/AutoLayoutController.js#L136-L139

Any insights as to what can lead subView.width be a negative number?