Diff
diff --git a/docs/cstyle/plugins/inline/index.html b/docs/cstyle/plugins/inline/index.html
index d50cb2c..8ee7e2e 100644
--- a/docs/cstyle/plugins/inline/index.html
+++ b/docs/cstyle/plugins/inline/index.html
@@ -57,84 +57,79 @@
- 31 if copyOfX < parent.X+parent.Padding.Left {
- 32 copyOfX = parent.X + parent.Padding.Left
- 33 }
- 34
- 35 // xCollect := float32(0)
- 36 for i, v := range n.Parent.Children {
- 37 // vState := s[v.Properties.Id]
- 38 if i > 0 {
- 39 if v.Style["position"] != "absolute" {
- 40 if v.Properties.Id == n.Properties.Id {
- 41 sib := n.Parent.Children[i-1]
- 42 sibling := s[sib.Properties.Id]
- 43 if sibling.X+sibling.Width+self.Width > (parent.Width+parent.X+parent.Border.Width)-parent.Padding.Left {
- 44 // Break Node.Id
- 45 self.Y = sibling.Y + sibling.Height
- 46 self.X = copyOfX
- 47 fmt.Println(n.InnerText, self.X, parent.X)
- 48 } else {
- 49 // Node did not break
- 50 if sib.Style["display"] != "inline" {
- 51 self.Y = sibling.Y + sibling.Height
- 52 } else {
- 53 self.Y = sibling.Y
- 54 self.X = sibling.X + sibling.Width
- 55 }
- 56 if n.InnerText != "" {
- 57 baseY := sibling.Y
- 58 var max float32
- 59 for a := i; a >= 0; a-- {
- 60 b := n.Parent.Children[a]
- 61 bStyle := s[b.Properties.Id]
- 62 if bStyle.Y == baseY {
- 63 if bStyle.EM > max {
- 64 max = bStyle.EM
- 65 }
- 66 }
- 67 }
- 68
- 69 for a := i; a >= 0; a-- {
- 70 b := n.Parent.Children[a]
- 71 bStyle := s[b.Properties.Id]
- 72 if bStyle.Y == baseY {
- 73 bStyle.Y += (float32(math.Ceil(float64((max - (max * 0.3))))) - float32(math.Ceil(float64(bStyle.EM-(bStyle.EM*0.3)))))
- 74 (*state)[b.Properties.Id] = bStyle
- 75 }
- 76 }
- 77 if self.Y == baseY {
- 78 self.Y += (float32(math.Ceil(float64((max - (max * 0.3))))) - float32(math.Ceil(float64(self.EM-(self.EM*0.3)))))
- 79 }
- 80 }
- 81
- 82 }
- 83 break
- 84 }
- 85 }
- 86 }
- 87
- 88 }
- 89 propagateOffsets(n, copyOfX, copyOfY, self, state)
- 90 (*state)[n.Properties.Id] = self
- 91 },
- 92 }
- 93}
- 94
- 95func propagateOffsets(n *element.Node, copyOfX, copyOfY float32, self element.State, state *map[string]element.State) {
- 96 s := *state
- 97 for _, v := range n.Children {
- 98 vState := s[v.Properties.Id]
- 99 vState.X += self.X - copyOfX
-100 vState.Y += self.Y - copyOfY
-101 if len(v.Children) > 0 {
-102 propagateOffsets(v, copyOfX, copyOfY, self, state)
-103 }
-104 (*state)[v.Properties.Id] = vState
-105 }
-106}
-107
-108// func colliderDetection(s1, s2 element.State) bool {
-109// s1Min := s1.Y
-110// s1Max := s1.Y + s1.Height
-111// s2Min := s2.Y
-112// s2Max := s2.Y + s2.Height
-113// return s1Min > s2Min && s1Min < s2Max || s1Max > s2Min && s1Min < s2Max || s2Min > s1Min && s2Min < s1Max || s2Max > s1Min && s2Min < s1Max
-114// }
+ 31
+ 32 // xCollect := float32(0)
+ 33 for i, v := range n.Parent.Children {
+ 34 // vState := s[v.Properties.Id]
+ 35 if i > 0 {
+ 36 if v.Style["position"] != "absolute" {
+ 37 if v.Properties.Id == n.Properties.Id {
+ 38 sib := n.Parent.Children[i-1]
+ 39 sibling := s[sib.Properties.Id]
+ 40 if sibling.X+sibling.Width+self.Width > (parent.Width)+parent.X {
+ 41 // Break Node.Id
+ 42 self.Y = sibling.Y + sibling.Height
+ 43 self.X = copyOfX
+ 44 fmt.Println(n.InnerText, sibling.X+sibling.Width, self.Width)
+ 45 } else {
+ 46 // Node did not break
+ 47 if sib.Style["display"] != "inline" {
+ 48 self.Y = sibling.Y + sibling.Height
+ 49 } else {
+ 50 self.Y = sibling.Y
+ 51 self.X = sibling.X + sibling.Width
+ 52 }
+ 53 }
+ 54 // !ISSUE: should prob only tgt elements with text
+ 55 baseY := sibling.Y
+ 56 var max float32
+ 57 for a := i; a >= 0; a-- {
+ 58 b := n.Parent.Children[a]
+ 59 bStyle := s[b.Properties.Id]
+ 60 if bStyle.Y == baseY {
+ 61 if bStyle.EM > max {
+ 62 max = bStyle.EM
+ 63 }
+ 64 }
+ 65 }
+ 66
+ 67 for a := i; a >= 0; a-- {
+ 68 b := n.Parent.Children[a]
+ 69 bStyle := s[b.Properties.Id]
+ 70 if bStyle.Y == baseY {
+ 71 bStyle.Y += (float32(math.Ceil(float64((max - (max * 0.3))))) - float32(math.Ceil(float64(bStyle.EM-(bStyle.EM*0.3)))))
+ 72 (*state)[b.Properties.Id] = bStyle
+ 73 }
+ 74 }
+ 75 if self.Y == baseY {
+ 76 self.Y += (float32(math.Ceil(float64((max - (max * 0.3))))) - float32(math.Ceil(float64(self.EM-(self.EM*0.3)))))
+ 77 }
+ 78 break
+ 79 }
+ 80 }
+ 81 }
+ 82
+ 83 }
+ 84 propagateOffsets(n, copyOfX, copyOfY, self, state)
+ 85 (*state)[n.Properties.Id] = self
+ 86 },
+ 87 }
+ 88}
+ 89
+ 90func propagateOffsets(n *element.Node, copyOfX, copyOfY float32, self element.State, state *map[string]element.State) {
+ 91 s := *state
+ 92 for _, v := range n.Children {
+ 93 vState := s[v.Properties.Id]
+ 94 vState.X += self.X - copyOfX
+ 95 vState.Y += self.Y - copyOfY
+ 96 if len(v.Children) > 0 {
+ 97 propagateOffsets(v, copyOfX, copyOfY, self, state)
+ 98 }
+ 99 (*state)[v.Properties.Id] = vState
+100 }
+101}
+102
+103// func colliderDetection(s1, s2 element.State) bool {
+104// s1Min := s1.Y
+105// s1Max := s1.Y + s1.Height
+106// s2Min := s2.Y
+107// s2Max := s2.Y + s2.Height
+108// return s1Min > s2Min && s1Min < s2Max || s1Max > s2Min && s1Min < s2Max || s2Min > s1Min && s2Min < s1Max || s2Max > s1Min && s2Min < s1Max
+109// }