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

Method LockToGrid

utils.go:186–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184}
185
186func (point Vector) LockToGrid() Vector {
187 return Vector{
188 X: float32(math.Round(float64(point.X/globals.GridSize)) * float64(globals.GridSize)),
189 Y: float32(math.Round(float64(point.Y/globals.GridSize)) * float64(globals.GridSize)),
190 }
191}
192
193func (point Vector) CeilToGrid() Vector {
194 return Vector{

Callers 2

HandleExternalPasteMethod · 0.80
DefaultSizeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected