summaryrefslogtreecommitdiff
path: root/grid.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-05-09 08:25:10 -0500
committerJeff Carr <[email protected]>2023-05-09 08:25:10 -0500
commite19a728d7fe0059b87e7af84c7155fd6559ced6d (patch)
treeb0e40a9102137b73570fc624df03c78f01aaa10e /grid.go
parent52b197ebf33192eaeda64bbd4acb2e283a45b097 (diff)
andlabs grid placement still broken
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'grid.go')
-rw-r--r--grid.go31
1 files changed, 10 insertions, 21 deletions
diff --git a/grid.go b/grid.go
index 9bcc105..c2daaa5 100644
--- a/grid.go
+++ b/grid.go
@@ -27,10 +27,8 @@ func (n *Node) NewGrid(name string, w int, h int) *Node {
log(debugChange, "click() NewGrid not defined =", name)
})
- var a toolkit.Action
- a.ActionType = toolkit.Add
- a.Name = name
- a.Text = name
+ a := newAction(n, toolkit.Add)
+
a.X = w
a.Y = h
newNode.X = w
@@ -38,29 +36,20 @@ func (n *Node) NewGrid(name string, w int, h int) *Node {
newNode.NextX = 1
newNode.NextY = 1
- /*
- // fix values here if they are invalid. Index starts at 1
- if (where.NextX < 1) {
- where.NextX = 1
- }
- if (where.NextY < 1) {
- where.NextY = 1
- }
- //
- a.X = where.NextX
- a.Y = where.NextY
- */
+ sendAction(a, newNode, n)
- newaction(&a, newNode, n)
+ return newNode
+}
- /*
+// increments where the next element in the grid should go
+func placeGrid(a *toolkit.Action, n *Node, where *Node) {
where.NextY += 1
if (where.NextY > where.Y) {
where.NextX += 1
where.NextY = 1
}
- log(logInfo, "Action() END size (X,Y)", where.X, where.Y, "put next thing at (X,Y) =", where.NextX, where.NextY)
- */
- return newNode
+ a.X = where.NextX
+ a.Y = where.NextY
+ log(logNow, "placeGrid() (X,Y)", where.X, where.Y, " next(X,Y) =", where.NextX, where.NextY)
}