Cascade other style options to children when requested

This commit is contained in:
Christian Muehlhaeuser
2019-12-05 14:07:10 +01:00
parent eaed263d06
commit c4b02ad80d
13 changed files with 120 additions and 59 deletions
+4 -4
View File
@@ -29,10 +29,10 @@ func (s BlockStack) Indent() uint {
var i uint
for _, v := range s {
if v.Style == nil {
if v.Style == nil || v.Style.Indent == nil {
continue
}
i += v.Style.Indent
i += *v.Style.Indent
}
return i
@@ -42,10 +42,10 @@ func (s BlockStack) Margin() uint {
var i uint
for _, v := range s {
if v.Style == nil {
if v.Style == nil || v.Style.Margin == nil {
continue
}
i += v.Style.Margin
i += *v.Style.Margin
}
return i