@@ -14,32 +14,14 @@ import {
1414 ViewportPoint
1515} from './types'
1616
17- export function minPatternNumber < N extends PatternNumber > ( a : N , b : N ) : N {
17+ function minPatternNumber < N extends PatternNumber > ( a : N , b : N ) : N {
1818 return Math . min ( a , b ) as N
1919}
2020
21- export function maxPatternNumber < N extends PatternNumber > ( a : N , b : N ) : N {
21+ function maxPatternNumber < N extends PatternNumber > ( a : N , b : N ) : N {
2222 return Math . max ( a , b ) as N
2323}
2424
25- const getBoundariesFromTwoPoints = < N extends PatternNumber > ( [ x1 , y1 ] : Point < N > , [ x2 , y2 ] : Point < N > ) : Boundaries < N > => {
26- return {
27- xMin : minPatternNumber ( x1 , x2 ) ,
28- xMax : maxPatternNumber ( x1 , x2 ) ,
29- yMin : minPatternNumber ( y1 , y2 ) ,
30- yMax : maxPatternNumber ( y1 , y2 ) ,
31- }
32- }
33-
34- export const normalizePattern = < N extends PatternNumber > ( pattern : Pattern < N > ) : Pattern < N > => {
35- const { xMin, xMax, yMin, yMax } = getBoundariesFromPattern ( pattern )
36-
37- return {
38- anchor : [ xMin , yMin ] ,
39- target : [ xMax , yMax ] ,
40- }
41- }
42-
4325/**
4426 * This function mutates the boundaries object in place.
4527 *
@@ -57,14 +39,14 @@ export function mutateBoundariesFromPattern<N extends PatternNumber>(pattern: Pa
5739}
5840
5941
60- export const getBoundariesFromPattern = < N extends PatternNumber > ( pattern : Pattern < N > ) : Boundaries < N > => {
42+ const getBoundariesFromPattern = < N extends PatternNumber > ( pattern : Pattern < N > ) : Boundaries < N > => {
6143 const obj : Boundaries < N > = { xMin : 0 as N , xMax : 0 as N , yMin : 0 as N , yMax : 0 as N }
6244 mutateBoundariesFromPattern ( pattern , obj )
6345 return obj
6446}
6547
6648
67- export const pointIsInBoundaries = < N extends PatternNumber > ( point : Point < N > , boundaries : Boundaries < N > ) : boolean => {
49+ const pointIsInBoundaries = < N extends PatternNumber > ( point : Point < N > , boundaries : Boundaries < N > ) : boolean => {
6850 const { xMin, xMax, yMin, yMax } = boundaries
6951 const [ pointX , pointY ] = point
7052
@@ -75,7 +57,7 @@ const pointIsInPattern = (point: AbsolutePoint, pattern: AbsolutePattern): boole
7557 return pointIsInBoundaries ( point , getBoundariesFromPattern ( pattern ) )
7658}
7759
78- export const mapPointToViewportSpace = (
60+ const mapPointToViewportSpace = (
7961 [ x , y ] : AbsolutePoint ,
8062 [ viewportWidth , viewportHeight ] : Size
8163) : ViewportPoint => {
0 commit comments