File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -113,18 +113,25 @@ const shift = (spacing: Spacing, point: Position): Spacing => ({
113113 right : spacing . right + point . x ,
114114} ) ;
115115
116+ const noSpacing : Spacing = {
117+ top : 0 ,
118+ right : 0 ,
119+ bottom : 0 ,
120+ left : 0 ,
121+ } ;
122+
116123type CreateBoxArgs = { |
117124 borderBox : AnyRectType ,
118- margin : Spacing ,
119- border : Spacing ,
120- padding : Spacing ,
125+ margin ? : Spacing ,
126+ border ? : Spacing ,
127+ padding ? : Spacing ,
121128| } ;
122129
123130export const createBox = ( {
124131 borderBox,
125- margin,
126- border,
127- padding,
132+ margin = noSpacing ,
133+ border = noSpacing ,
134+ padding = noSpacing ,
128135} : CreateBoxArgs ) : BoxModel => {
129136 // marginBox = borderBox + margin
130137 const marginBox : Rect = getRect ( expand ( borderBox , margin ) ) ;
You can’t perform that action at this time.
0 commit comments