Transfers a segment of a (1->4)-alpha-D-glucan chain to a primary hydroxy group in a similar glucan chain. Glycan biosynthesis; glycogen biosynthesis. Belongs to the glycosyl hydrolase 13 family. GlgB subfamily.