Jump to content

GUI Paddings Eating GUI Control Size


Recommended Posts

Hi guys.


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!

Link to comment
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..

Link to comment
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.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...