May 2019
Intermediate to advanced
496 pages
10h 38m
English
The current Drawing component already draws a set of lines. Our first job is to extract that into its own component, named StaticLines.
export const horizontalLine = { drawCommand: 'drawLine', id: 123, x1: 100, y1: 100, x2: 200, y2: 100};export const verticalLine = { drawCommand: 'drawLine', id: 234, x1: 200, y1: 100, x2: 200, y2: 200};export const diagonalLine = { drawCommand: 'drawLine', id: 235, x1: 200, y1: 200, x2: 300, y2: 300};
Read now
Unlock full access