xamarin / flex

Flex is a flexible box layout system written in C, designed to be easy to consume from other languages
MIT License
194 stars 28 forks source link

Setting only Width/Height on Item results in FrameWidth/FrameHeight being 0 #41

Closed brettclutch closed 6 years ago

brettclutch commented 6 years ago

FlexBugReport.zip

Attached is source code example containing these simple lines where I don't get any width/height in FrameWidth/Heigth as I expect on the top level root 'Item' (Item with no parent). Can you please take a look (please advise if I'm doing something wrong or have an incorrect assumption). Thanks.

` Item rootItem = new Item(); rootItem.Width = 800; rootItem.Height = 800;

rootItem.Layout();

Console.WriteLine($"Frame Height: {rootItem.FrameHeight}, Frame Width: {rootItem.FrameWidth}"); Console.ReadLine(); `

Outputs: Frame Height: 0, Frame Width: 0

brettclutch commented 6 years ago

Any feedback on that issue? Sorry to be a bother but I can't pull off the curb since this is a core blocker to even using the library since I can never assign the root node any height / width of which to start any layout calculations.

lrz commented 6 years ago

Sorry we don't have feedback at this point. We will consider this issue, you can also submit a pull request with a proper fix if you make one.

brettclutch commented 6 years ago

That's ok, since I couldn't pull off the curb I switched back to Facebook yoga. Thanks for the effort on the library share.