Diff
diff --git a/painter/main.go b/painter/main.go
index ac41e13..3f22cbb 100644
--- a/painter/main.go
+++ b/painter/main.go
@@ -24 +24 @@ type WindowManager struct {
- nodes []Rect
+ rectangles []Rect
@@ -54,2 +54,2 @@ func (wm *WindowManager) CloseWindow() {
-func (wm *WindowManager) AddNode(rect Rect) {
- wm.nodes = append(wm.nodes, rect)
+func (wm *WindowManager) AddRectangle(rect Rect) {
+ wm.rectangles = append(wm.rectangles, rect)
@@ -58,3 +58,3 @@ func (wm *WindowManager) AddNode(rect Rect) {
-// RemoveAllNods removes all nodes from the window
-func (wm *WindowManager) RemoveAllNodes() {
- wm.nodes = nil
+// RemoveAllRectangles removes all rectangles from the window
+func (wm *WindowManager) RemoveAllRectangles() {
+ wm.rectangles = nil
@@ -63,2 +63,4 @@ func (wm *WindowManager) RemoveAllNodes() {
-// Draw draws all nodes on the window
-func (wm *WindowManager) Draw() {
+// DrawRectangles draws all rectangles on the window
+func (wm *WindowManager) DrawRectangles() {
+ rl.BeginDrawing()
+ rl.ClearBackground(rl.RayWhite)
@@ -66,3 +68,3 @@ func (wm *WindowManager) Draw() {
- for _, node := range wm.nodes {
- rl.DrawRectangleRec(node.Node, node.Color)
- if node.Text.Value != "" {
+ for _, pair := range wm.rectangles {
+ rl.DrawRectangleRec(pair.Node, pair.Color)
+ if pair.Text.Value != "" {
@@ -70,3 +72,3 @@ func (wm *WindowManager) Draw() {
- textHeight := node.Text.Size
- textX := node.Node.X
- textY := node.Node.Y + (node.Node.Height-float32(textHeight))/2
+ textHeight := pair.Text.Size
+ textX := pair.Node.X
+ textY := pair.Node.Y + (pair.Node.Height-float32(textHeight))/2
@@ -74 +76 @@ func (wm *WindowManager) Draw() {
- font := wm.Fonts[node.Text.Font]
+ font := wm.Fonts[pair.Text.Font]
@@ -77,2 +79,2 @@ func (wm *WindowManager) Draw() {
- font := rl.LoadFont(node.Text.Font)
- wm.Fonts[node.Text.Font] = font
+ font := rl.LoadFont(pair.Text.Font)
+ wm.Fonts[pair.Text.Font] = font
@@ -81 +83 @@ func (wm *WindowManager) Draw() {
- rl.DrawTextEx(font, node.Text.Value, rl.NewVector2(textX, textY), node.Text.Size, 2, node.Text.Color)
+ rl.DrawTextEx(font, pair.Text.Value, rl.NewVector2(textX, textY), pair.Text.Size, 2, pair.Text.Color)
@@ -88,0 +91,2 @@ func (wm *WindowManager) Draw() {
+
+ rl.EndDrawing()