@@ -9,8 +9,8 @@ function getViewBox(state: State): string {
99 let yMax = 1
1010
1111 // Make sure that default viewBox contains entire pattern
12- for ( const p of state . patterns ) {
13- const b = getBoundariesFromPattern ( p )
12+ for ( const { pattern } of state . patterns ) {
13+ const b = getBoundariesFromPattern ( pattern )
1414
1515 xMin = Math . min ( xMin , b . xMin )
1616 xMax = Math . max ( xMax , b . xMax )
@@ -71,8 +71,8 @@ export const Preview: React.FC<{ state: State }> = ({ state }) => {
7171 />
7272 < PartialLine anchor = { [ 0 , 0 ] } target = { [ 1 , 1 ] } />
7373
74- { state . patterns . map ( ( p , i ) => {
75- const { xMin, xMax, yMin, yMax } = getBoundariesFromPattern ( p )
74+ { state . patterns . map ( ( { pattern } , i ) => {
75+ const { xMin, xMax, yMin, yMax } = getBoundariesFromPattern ( pattern )
7676
7777 const width = xMax - xMin
7878 const height = yMax - yMin
@@ -90,7 +90,7 @@ export const Preview: React.FC<{ state: State }> = ({ state }) => {
9090 height = { height . toFixed ( 3 ) }
9191 />
9292 { /* Partial line from anchor to target in order to show the direction */ }
93- < PartialLine anchor = { p . anchor } target = { p . target } />
93+ < PartialLine anchor = { pattern . anchor } target = { pattern . target } />
9494
9595 { /* Click surfaces for rotation and resizing actions */ }
9696 { [
0 commit comments