Diff
diff --git a/docs/cstyle/plugins/inline/index.html b/docs/cstyle/plugins/inline/index.html
index 4548363..6dd1822 100644
--- a/docs/cstyle/plugins/inline/index.html
+++ b/docs/cstyle/plugins/inline/index.html
@@ -30,81 +30,82 @@
- 4 "gui/cstyle"
- 5 "gui/element"
- 6)
- 7
- 8func Init() cstyle.Plugin {
- 9 return cstyle.Plugin{
-10 Styles: map[string]string{
-11 "display": "inline",
-12 },
-13 Level: 1,
-14 Handler: func(n *element.Node, state *map[string]element.State) {
-15 s := *state
-16 self := s[n.Properties.Id]
-17 parent := s[n.Parent.Properties.Id]
-18 copyOfX := self.X
-19 copyOfY := self.Y
-20 xCollect := float32(0)
-21 // !ISSUE: Text doesn't break word
-22 for i, v := range n.Parent.Children {
-23 vState := s[v.Properties.Id]
-24 if v.Style["display"] != "inline" {
-25 xCollect = 0
-26 } else {
-27 if v.Properties.Id == n.Properties.Id {
-28 // then if the x coordinate of the current element plus the x shift from its prevous siblings and the width minus 2 pixels
-29 // is greater than the width of the parent plus it's x value
-30 // and it is not the first element
-31 if self.X+xCollect+self.Width > parent.Width+parent.X && i > 0 {
-32 // We need to shift the element
-33 // then find the prevous sibling and add its height to the Y value to shift it downwards
-34 // shift the element to the base x (which should be the parent x value) and reset the xCollect
-35 // fmt.Println(n.Properties.Id, "broke", xCollect, self.X, self.Width, parent.Width, parent.X)
-36 sibling := s[n.Parent.Children[i-1].Properties.Id]
-37 self.Y += sibling.Height
-38 self.X = copyOfX
-39 } else if i > 0 {
-40 // fmt.Println(n.Properties.Id, n.InnerText, "did not break", xCollect, self.X, self.Width, parent.Width)
-41 self.X += xCollect
-42 sibling := s[n.Parent.Children[i-1].Properties.Id]
-43 if sibling.Height != self.Height {
-44 self.Y += sibling.Height / 4
-45 }
-46 }
-47 break
-48 } else {
-49 if n.Parent.Children[i].Style["display"] == "inline" {
-50 if colliderDetection(vState, self) {
-51 xCollect += vState.Width
-52 } else {
-53 xCollect = 0
-54 }
-55 }
-56 }
-57 }
-58 }
-59 propagateOffsets(n, copyOfX, copyOfY, self, state)
-60 (*state)[n.Properties.Id] = self
-61 },
-62 }
-63}
-64
-65func propagateOffsets(n *element.Node, copyOfX, copyOfY float32, self element.State, state *map[string]element.State) {
-66 s := *state
-67 for _, v := range n.Children {
-68 vState := s[v.Properties.Id]
-69 vState.X += self.X - copyOfX
-70 vState.Y += self.Y - copyOfY
-71 if len(v.Children) > 0 {
-72 propagateOffsets(&v, copyOfX, copyOfY, self, state)
-73 }
-74 (*state)[v.Properties.Id] = vState
-75 }
-76}
-77
-78func colliderDetection(s1, s2 element.State) bool {
-79 s1Min := s1.Y
-80 s1Max := s1.Y + s1.Height
-81 s2Min := s2.Y
-82 s2Max := s2.Y + s2.Height
-83 return s1Min > s2Min && s1Min < s2Max || s1Max > s2Min && s1Min < s2Max || s2Min > s1Min && s2Min < s1Max || s2Max > s1Min && s2Min < s1Max
-84}
+ 4 "fmt"
+ 5 "gui/cstyle"
+ 6 "gui/element"
+ 7)
+ 8
+ 9func Init() cstyle.Plugin {
+10 return cstyle.Plugin{
+11 Styles: map[string]string{
+12 "display": "inline",
+13 },
+14 Level: 1,
+15 Handler: func(n *element.Node, state *map[string]element.State) {
+16 s := *state
+17 self := s[n.Properties.Id]
+18 parent := s[n.Parent.Properties.Id]
+19 copyOfX := self.X
+20 copyOfY := self.Y
+21 xCollect := float32(0)
+22 // !ISSUE: Text doesn't break word
+23 for i, v := range n.Parent.Children {
+24 vState := s[v.Properties.Id]
+25 if v.Style["display"] != "inline" {
+26 xCollect = 0
+27 } else {
+28 if v.Properties.Id == n.Properties.Id {
+29 // then if the x coordinate of the current element plus the x shift from its prevous siblings and the width minus 2 pixels
+30 // is greater than the width of the parent plus it's x value
+31 // and it is not the first element
+32 if self.X+xCollect+self.Width > parent.Width+parent.X && i > 0 {
+33 // We need to shift the element
+34 // then find the prevous sibling and add its height to the Y value to shift it downwards
+35 // shift the element to the base x (which should be the parent x value) and reset the xCollect
+36 fmt.Println(n.Properties.Id, "broke", xCollect, self.X, self.Width, parent.Width, parent.X)
+37 sibling := s[n.Parent.Children[i-1].Properties.Id]
+38 self.Y += sibling.Height
+39 self.X = copyOfX
+40 } else if i > 0 {
+41 fmt.Println(n.Properties.Id, n.InnerText, "did not break", xCollect, self.X, self.Width, parent.Width)
+42 self.X += xCollect
+43 sibling := s[n.Parent.Children[i-1].Properties.Id]
+44 if sibling.Height != self.Height {
+45 self.Y += sibling.Height / 4
+46 }
+47 }
+48 break
+49 } else {
+50 if n.Parent.Children[i].Style["display"] == "inline" {
+51 if colliderDetection(vState, self) {
+52 xCollect += vState.Width
+53 } else {
+54 xCollect = 0
+55 }
+56 }
+57 }
+58 }
+59 }
+60 propagateOffsets(n, copyOfX, copyOfY, self, state)
+61 (*state)[n.Properties.Id] = self
+62 },
+63 }
+64}
+65
+66func propagateOffsets(n *element.Node, copyOfX, copyOfY float32, self element.State, state *map[string]element.State) {
+67 s := *state
+68 for _, v := range n.Children {
+69 vState := s[v.Properties.Id]
+70 vState.X += self.X - copyOfX
+71 vState.Y += self.Y - copyOfY
+72 if len(v.Children) > 0 {
+73 propagateOffsets(&v, copyOfX, copyOfY, self, state)
+74 }
+75 (*state)[v.Properties.Id] = vState
+76 }
+77}
+78
+79func colliderDetection(s1, s2 element.State) bool {
+80 s1Min := s1.Y
+81 s1Max := s1.Y + s1.Height
+82 s2Min := s2.Y
+83 s2Max := s2.Y + s2.Height
+84 return s1Min > s2Min && s1Min < s2Max || s1Max > s2Min && s1Min < s2Max || s2Min > s1Min && s2Min < s1Max || s2Max > s1Min && s2Min < s1Max
+85}