copyFrom method
Copies the elements from another grid into this grid.
If source
is provided, only the elements within the bounds are copied.
A target
offset can be provided to copy the elements to a different
position in this
grid.
Implementation
void copyFrom(Grid<E> src, {Rect? source, Pos target = Pos.zero}) {
final dst = this;
if (source == null) {
source = src.bounds;
} else {
source = bounds.intersect(src.bounds);
}
copyRect(
source,
src.get,
dst.set,
target: target,
);
}