Wingnut Posted March 9, 2018 Share Posted March 9, 2018 Hi guys. https://www.babylonjs-playground.com/#91I2RE#47 In this PG, a simple ADT with image control. Timer adds more paddingBottom every 2 seconds. Watch control/image size. It shrinks to nearly nothing, then starts up-sizing. This symptom is same for all 4 paddings. My PG is coded to easily test any of the 4 types. It also happens when both alignments are set to CENTER, or when no alignments are set. For fun, after RUN, put pointer on TOP edge of yellow image, and leave it there. After button starts growing again, notice pointer is on BOTTOM edge of image. Strange and interesting. Anyway, I'm not sure if this is a bug, but I thought I better report it, and ask if this is expected behavior. Party on! Quote Link to comment Share on other sites More sharing options...
Guest Posted March 9, 2018 Share Posted March 9, 2018 Hello this is not a bug:) padding is not margin: it is defined inside the control itself (we could call it an internal margin) This is what I try to capture in the bottom note of this chapter: http://doc.babylonjs.com/how_to/gui#position-and-size But with my broken english I may have failed Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted March 9, 2018 Share Posted March 9, 2018 Looks like "unexpected" coding behaviour rather than a bug Padding are added inside the element, so e.g. when paddingBottom exceed height of the element, suddenly the measurement used for rendering = position - ( height(80) - paddingBottom(135) = -55) if that makes any sense.. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 9, 2018 Author Share Posted March 9, 2018 Yeah, thanks guys. English is fine in docs, too... I just need to read them. Sorry for the mis-fire on my part. Yep, I was treating them like margins. These paddings are like outerHTML paddings, used on the innerHTML/innerText. Interesting. So, I really need... ADT.paddings. But ADT's are not containers... or are they? I think they are. One big rectangle container. Actually, I need to learn more about containers. More about everything, really. https://www.babylonjs-playground.com/#91I2RE#48 (.top and .left for positioning within the ADT) https://www.babylonjs-playground.com/#91I2RE#49 (same .top and .left for rectangle containers) Smokin'! Thx agn, guys. Delete this whole thread, or move to Q&A, if wanted/ok-with-participants. GameMonetize 1 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.