In the case of a button, adjusting the padding of the element changes the size between our button text/sprite and the edge of the button. Adjusting the margin would affect the space between the edge of the button and the surrounding elements.
In a brief discussion on discord, Aidiakapi chimed in with pointing out how the "box model" works in regards to margins of neighboring elements:
Box model is apparently the model used in web browsers. Though, this might be beyond the necessary scope of what anyone would need in Factorio GUI development.Aidiakapi wrote:In addition, in things like the box model, margins collapse (ie. top margin collapses with the bottom margin of the element above it, basically:Code: Select all
effective_margin = max(top_element.bottom_margin, bottom_element.top_margin))