// Copy copies elements from a source grid src into the destination grid gd,
// and returns the copied grid-slice size, which is the minimum of both grids
// for each dimension. The result is independent of whether the two grids
// referenced memory overlaps or not.
Copy copies elements from a source grid src into the destination grid gd,
and returns the copied grid-slice size, which is the minimum of both grids
for each dimension. The result is independent of whether the two grids
referenced memory overlaps or not.
// Copy copies elements from a source grid src into the destination grid gd // and returns the copied grid - slice size which is the minimum of both grids // for each dimension . The result is independent of whether the two grids // referenced memory overlaps or not .
func (gd Grid) Copy(src Grid) gruid.Point {
	if gd.Ug == nil {
		return gruid.Point{}
	}
	if gd.Ug != src.Ug {
		if src.Rg.Max.X-src.Rg.Min.X <= 4 {
			return gd.cpv(src)
		}
		return gd.cp(src)
	}
	if gd.Rg == src.Rg {
		return gd.Rg.Size()
	}
	if !gd.Rg.Overlaps(src.Rg) || gd.Rg.Min.Y <= src.Rg.Min.Y {
		return gd.cp(src)
	}
	return gd.cprev(src)
}
func ( gd Grid ) Copy ( src Grid ) gruid . Point { if gd . Ug == nil { return gruid . Point { } } if gd . Ug != src . Ug { if src . Rg . Max . X - src . Rg . Min . X <= 4 { return gd . cpv ( src ) } return gd . cp ( src ) } if gd . Rg == src . Rg { return gd . Rg . Size ( ) } if ! gd . Rg . Overlaps ( src . Rg ) || gd . Rg . Min . Y <= src . Rg . Min . Y { return gd . cp ( src ) } return gd . cprev ( src ) }
Copy copies elements from a source grid src into the destination grid gd,
and returns the copied grid-slice size, which is the minimum of both grids
for each dimension.
Copy copies elements from a source grid src into the destination grid gd and returns the copied grid - slice size which is the minimum of both grids for each dimension .