LayerData.idxToRow

get the row corresponding to a position in the data or objects array.

struct LayerData
@property
idxToRow
(
size_t idx
)

Examples

LayerData layer;
layer.numCols = 3;
layer.numRows = 2;

assert(layer.idxToRow(0) == 0);
assert(layer.idxToRow(1) == 0);
assert(layer.idxToRow(2) == 0);
assert(layer.idxToRow(3) == 1);
assert(layer.idxToRow(4) == 1);
assert(layer.idxToRow(5) == 1);

Meta