Diff
diff --git a/cstyle/plugins/inline/main.go b/cstyle/plugins/inline/main.go
index 948a1d1..786567d 100644
--- a/cstyle/plugins/inline/main.go
+++ b/cstyle/plugins/inline/main.go
@@ -14,6 +14,2 @@ 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]
-
- copyOfX := self.X
+ Handler: func(n *element.Node) {
+ copyOfX := n.Properties.X
@@ -22,4 +18,3 @@ func Init() cstyle.Plugin {
- if self.X+self.Width-2 > parent.Width+copyOfX && i > 0 {
- sibling := s[n.Parent.Children[i-1].Properties.Id]
- self.Y += sibling.Height
- self.X = copyOfX
+ if n.Properties.X+n.Properties.Computed["width"]-2 > n.Parent.Properties.Computed["width"]+copyOfX && i > 0 {
+ n.Properties.Y += float32(n.Parent.Children[i-1].Properties.Computed["height"])
+ n.Properties.X = copyOfX
@@ -29,5 +24,3 @@ func Init() cstyle.Plugin {
- sibling := s[n.Parent.Children[i-1].Properties.Id]
-
- if sibling.Text.X+self.Text.Width < int(sibling.Width) {
- self.Y -= float32(sibling.Text.LineHeight)
- self.X += float32(sibling.Text.X)
+ if n.Parent.Children[i-1].Properties.Text.X+n.Properties.Text.Width < int(n.Parent.Children[i-1].Properties.Computed["width"]) {
+ n.Properties.Y -= float32(n.Parent.Children[i-1].Properties.Text.LineHeight)
+ n.Properties.X += float32(n.Parent.Children[i-1].Properties.Text.X)
@@ -39,2 +32 @@ func Init() cstyle.Plugin {
- vState := s[v.Properties.Id]
- self.X += vState.Width
+ n.Properties.X += v.Properties.Computed["width"]
@@ -42 +34 @@ func Init() cstyle.Plugin {
- self.X = copyOfX
+ n.Properties.X = copyOfX
@@ -45,2 +36,0 @@ func Init() cstyle.Plugin {
- (*state)[n.Properties.Id] = self
- (*state)[n.Parent.Properties.Id] = parent