Diff
diff --git a/document/main.go b/document/main.go
index af8457c..185d826 100644
--- a/document/main.go
+++ b/document/main.go
@@ -29 +29 @@ func (doc Document) Open(index string, script func(*element.Node)) {
- // d := parse(index)
+ d := parse(index)
@@ -52,3 +52,3 @@ func (doc Document) Open(index string, script func(*element.Node)) {
- // for _, v := range d.StyleSheets {
- // doc.CSS.StyleSheet(v)
- // }
+ for _, v := range d.StyleSheets {
+ doc.CSS.StyleSheet(v)
+ }
@@ -56,3 +56,3 @@ func (doc Document) Open(index string, script func(*element.Node)) {
- // for _, v := range d.StyleTags {
- // doc.CSS.StyleTag(v)
- // }
+ for _, v := range d.StyleTags {
+ doc.CSS.StyleTag(v)
+ }
@@ -60,2 +60,2 @@ func (doc Document) Open(index string, script func(*element.Node)) {
- // nodes := doc.CSS.CreateDocument(d.DOM)
- // root := &nodes
+ nodes := doc.CSS.CreateDocument(d.DOM)
+ root := &nodes
@@ -63 +63 @@ func (doc Document) Open(index string, script func(*element.Node)) {
- // script(root)
+ script(root)
@@ -76,22 +76,22 @@ func (doc Document) Open(index string, script func(*element.Node)) {
- // newWidth := int32(rl.GetScreenWidth())
- // newHeight := int32(rl.GetScreenHeight())
-
- // if newWidth != screenWidth || newHeight != screenHeight {
- // rl.ClearBackground(rl.RayWhite)
- // // Window has been resized, handle the event
- // screenWidth = newWidth
- // screenHeight = newHeight
-
- // doc.CSS.Width = float32(screenWidth)
- // doc.CSS.Height = float32(screenHeight)
-
- // nodes = doc.CSS.CreateDocument(d.DOM)
- // root = &nodes
- // script(root)
- // }
-
- // eventStore = events.GetEvents(root, eventStore)
- // doc.CSS.ComputeNodeStyle(root)
- // rd := doc.CSS.Render(*root)
- // wm.LoadTextures(rd)
- // wm.Draw(rd)
+ newWidth := int32(rl.GetScreenWidth())
+ newHeight := int32(rl.GetScreenHeight())
+
+ if newWidth != screenWidth || newHeight != screenHeight {
+ rl.ClearBackground(rl.RayWhite)
+ // Window has been resized, handle the event
+ screenWidth = newWidth
+ screenHeight = newHeight
+
+ doc.CSS.Width = float32(screenWidth)
+ doc.CSS.Height = float32(screenHeight)
+
+ nodes = doc.CSS.CreateDocument(d.DOM)
+ root = &nodes
+ script(root)
+ }
+
+ eventStore = events.GetEvents(root, eventStore)
+ doc.CSS.ComputeNodeStyle(root)
+ rd := doc.CSS.Render(*root)
+ wm.LoadTextures(rd)
+ wm.Draw(rd)