MCPcopy Create free account
hub / github.com/SolarLune/masterplan / Update

Method Update

stack.go:41–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39}
40
41func (stack *Stack) Update() {
42
43 grid := stack.Card.Page.Grid
44
45 var above *Card
46
47 grid.ForEachCardAbove(stack.Card, func(c *Card) bool {
48 if c != stack.Card && stack.Card.PinnedTo != c {
49 above = c
50 return false
51 }
52 return true
53 })
54
55 stack.Above = above
56
57 var below *Card
58
59 grid.ForEachCardBelow(stack.Card, func(c *Card) bool {
60 if c != stack.Card && stack.Card.PinnedTo != c {
61 below = c
62 return false
63 }
64 return true
65 })
66
67 // Prevent looping
68
69 if below != nil && (below == above || below == stack.Card) {
70 below = nil
71 }
72
73 if above == stack.Card {
74 above = nil
75 }
76
77 stack.Below = below
78
79}
80
81func (stack *Stack) PostUpdate() {
82

Callers

nothing calls this directly

Calls 2

ForEachCardAboveMethod · 0.80
ForEachCardBelowMethod · 0.80

Tested by

no test coverage detected