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

Method Select

grid.go:298–308  ·  view source on GitHub ↗

CardRectToGrid converts the card's rectangle to two absolute grid points representing the card's extents in absolute grid spaces. func (grid *Grid) CardRectToGrid(rect *sdl.FRect) []Point { return []Point{ {grid.LockPosition(rect.X), grid.LockPosition(rect.Y)}, {grid.LockPosition(rect.X + rect.

(rect *sdl.FRect)

Source from the content-addressed store, hash-verified

296// }
297
298func (grid *Grid) Select(rect *sdl.FRect) GridSelection {
299
300 return NewGridSelection(
301 grid.LockPosition(rect.X),
302 grid.LockPosition(rect.Y),
303 grid.LockPosition(rect.X+rect.W),
304 grid.LockPosition(rect.Y+rect.H),
305 grid,
306 )
307
308}
309
310func (grid *Grid) LockPosition(position float32) float32 {
311

Callers 7

PutMethod · 0.95
CardsInCardShapeMethod · 0.95
CardsInAreaMethod · 0.95
AddMethod · 0.45
UpdateMethod · 0.45
ConstructMenusFunction · 0.45

Calls 2

LockPositionMethod · 0.95
NewGridSelectionFunction · 0.85

Tested by

no test coverage detected