Xed89 Posted July 17, 2018 Share Posted July 17, 2018 I need to display a list of cards, and used a stackpanel for that. The cards should have some space between them, and i saw there's the padding property so i tried it. Problem 1: If i set the padding to the stackpanel, the cards get clipped because the padding is removed from the stackpanel available width for its children. Problem 2: The padding set on the second card gets removed from the card width, thus i need to increase its width by the same amount of the padding i need. Doesn't seem right. Maybe we need also a margin property if this behavior is by design? Playground to reproduce the bugs: https://www.babylonjs-playground.com/#F1Z1SC#1 Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2018 Share Posted July 17, 2018 Yes the padding is within the size of the control. In your case the easy way is to introduce separators: https://www.babylonjs-playground.com/#F1Z1SC#2 (Not a bug so I moved the topic to Questions) Quote Link to comment Share on other sites More sharing options...
Xed89 Posted July 18, 2018 Author Share Posted July 18, 2018 Oh i see:) and what about the stackpanel margin? I still want it to stretch relative to the container rectangle but have a 10px margin around.. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 18, 2018 Share Posted July 18, 2018 for the stackPanel itself, using .left should make it 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.