MCPcopy Create free account
hub / github.com/cogentcore/core / Cmd

Method Cmd

svg/path.go:206–211  ·  view source on GitHub ↗

Cmd decodes path data as a command and a number of subsequent values for that command

()

Source from the content-addressed store, hash-verified

204
205// Cmd decodes path data as a command and a number of subsequent values for that command
206func (pd PathData) Cmd() (PathCmds, int) {
207 iv := uint32(pd)
208 cmd := PathCmds(iv & 0x1F) // only the lowest 5 bits (31 values) for command
209 n := int((iv & 0xFFFFFFE0) >> 5) // extract the n from remainder of bits
210 return cmd, n
211}
212
213// EncCmd encodes command and n into PathData
214func (pc PathCmds) EncCmd(n int) PathData {

Callers 2

PathDataNextCmdFunction · 0.80
PathDataParseFunction · 0.80

Calls 1

PathCmdsTypeAlias · 0.85

Tested by

no test coverage detected