Sign in to follow this  
Wingnut

GUI Paddings Eating GUI Control Size

Recommended Posts

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!

Share this post


Link to post
Share on other sites

Looks like "unexpected" coding behaviour rather than a bug :P 
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..

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.