Diff
diff --git a/cstyle/plugins/block/main.go b/cstyle/plugins/block/main.go
index a026953..e3a32c4 100644
--- a/cstyle/plugins/block/main.go
+++ b/cstyle/plugins/block/main.go
@@ -15,5 +15 @@ func Init() cstyle.Plugin {
- Handler: func(n *element.Node, state *map[string]element.State) {
- s := *state
- self := s[n.Properties.Id]
- parent := s[n.Parent.Properties.Id]
-
+ Handler: func(n *element.Node) {
@@ -23 +19 @@ func Init() cstyle.Plugin {
- self.Width, _ = utils.ConvertToPixels("100%", self.EM, parent.Width)
+ n.Properties.Computed["width"], _ = utils.ConvertToPixels("100%", n.Properties.EM, n.Parent.Properties.Computed["width"])
@@ -25 +21 @@ func Init() cstyle.Plugin {
- self.Width -= m.Right + m.Left
+ n.Properties.Computed["width"] -= m.Right + m.Left
@@ -28 +24 @@ func Init() cstyle.Plugin {
- self.Width += p.Right + p.Left
+ n.Properties.Computed["width"] += p.Right + p.Left
@@ -30,2 +25,0 @@ func Init() cstyle.Plugin {
- (*state)[n.Properties.Id] = self
- (*state)[n.Parent.Properties.Id] = parent