MarginLayoutConfigurable¶
Overview¶
This combines the margin-cell related options common to FlowConfigurable and GridConfigurable Parent mixin for flow/grid configurables (mixins for storing options that can affect each cell). null
for values usually means "inherit from the default".
NOTE: This is mixed into both the constraint AND the cell, since we have two layers of options. The null
meaning "inherit from the default" is mainly used for the cells, so that if it's not specified in the cell, it will be specified in the constraint (as non-null).
NOTE: This is a mixin meant to be used internally only by Scenery (for the constraint and cell), and should not be used by outside code.
@author Jonathan Olson <jonathan.olson@colorado.edu>
Type ExternalMarginLayoutConfigurableOptions¶
We remove the null values for the values that won't actually take null
WithoutNull<MarginLayoutConfigurableOptions, Exclude<keyof MarginLayoutConfigurableOptions, "minContentWidth" | "minContentHeight" | "maxContentWidth" | "maxContentHeight">>
Type MarginLayoutConfigurableOptions¶
- margin?: number | null
Adds extra space for each cell in the layout (margin controls all 4 sides, xMargin controls left/right, yMargin controls top/bottom). See https://phetsims.github.io/scenery/doc/layout#FlowBox-margins See https://phetsims.github.io/scenery/doc/layout#GridBox-margins Margins will control how much extra space is FORCED around content within a cell's available area. These margins do not collapse (each cell gets its own). - xMargin?: number | null
- yMargin?: number | null
- leftMargin?: number | null
- rightMargin?: number | null
- topMargin?: number | null
- bottomMargin?: number | null
- minContentWidth?: number | null
Forces size minimums and maximums on the cells (which does not include the margins). NOTE: For these, the nullable portion is actually part of the possible "value" See https://phetsims.github.io/scenery/doc/layout#FlowBox-minContent and https://phetsims.github.io/scenery/doc/layout#FlowBox-maxContent See https://phetsims.github.io/scenery/doc/layout#GridBox-minContent and https://phetsims.github.io/scenery/doc/layout#GridBox-maxContent - minContentHeight?: number | null
- maxContentWidth?: number | null
- maxContentHeight?: number | null
Type TMarginLayoutConfigurable¶
- _leftMargin: number | null
- _rightMargin: number | null
- _topMargin: number | null
- _bottomMargin: number | null
- _minContentWidth: number | null
- _minContentHeight: number | null
- _maxContentWidth: number | null
- _maxContentHeight: number | null
- changedEmitter: TEmitter
- leftMargin: number | null
- rightMargin: number | null
- topMargin: number | null
- bottomMargin: number | null
- xMargin: number | null
- yMargin: number | null
- margin: number | null
- minContentWidth: number | null
- minContentHeight: number | null
- maxContentWidth: number | null
- maxContentHeight: number | null
Source Code¶
See the source for MarginLayoutConfigurable.ts in the scenery repository.