AddShapes returns a new shape by adding two shapes one after the other.
(shape1, shape2 *Shape)
| 232 | |
| 233 | // AddShapes returns a new shape by adding two shapes one after the other. |
| 234 | func AddShapes(shape1, shape2 *Shape) *Shape { |
| 235 | sh1 := shape1.Sizes |
| 236 | sh2 := shape2.Sizes |
| 237 | nsh := make([]int, len(sh1)+len(sh2)) |
| 238 | copy(nsh, sh1) |
| 239 | copy(nsh[len(sh1):], sh2) |
| 240 | nms := make([]string, len(sh1)+len(sh2)) |
| 241 | copy(nms, shape1.Names) |
| 242 | copy(nms[len(sh1):], shape2.Names) |
| 243 | return NewShape(nsh, nms...) |
| 244 | } |
nothing calls this directly
no test coverage detected