Skip to content

Commit b480595

Browse files
committed
Remove asAbsolutePoint
1 parent 19d4fa2 commit b480595

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
getRelativePatternPosition,
99
} from './functions'
1010
import { useStableFunction } from './hooks'
11-
import { AbsolutePattern, AbsolutePoint, RelativePattern, State, asAbsolutePoint } from './types'
11+
import { AbsolutePattern, AbsolutePoint, NumberPair, RelativePattern, State } from './types'
1212

1313
const getDraftState = (state: State, draftClick: DraftClick, mousePosition: AbsolutePoint): State => {
1414
const draftPattern = {
@@ -52,7 +52,7 @@ const useOnKeydown = (f: (e: KeyboardEvent) => void) => {
5252
}, [stableCallback])
5353
}
5454

55-
const BASE_MOUSE_POSITION = asAbsolutePoint([0, 0])
55+
const BASE_MOUSE_POSITION = [0, 0] satisfies NumberPair as AbsolutePoint
5656

5757
const BASE_STATE = {
5858
screens: [],

src/draw/stream-batched-drawable-patterns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Size, State, ViewportPattern } from '../types'
22
import { streamDrawablePatterns } from './stream-drawable-patterns'
33

4-
export type DrawableChunk = {
4+
type DrawableChunk = {
55
depth: number
66
patterns: ViewportPattern[]
77
}

src/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ export type AbsolutePoint = Point<AbsoluteNumber>
2222
// absolute point in viewport space
2323
export type ViewportPoint = Point<ViewportNumber>
2424

25-
export const asAbsolutePoint = (point: NumberPair): AbsolutePoint => point as AbsolutePoint
26-
2725
export type Size = [width: number, height: number]
2826

2927
export type Pattern<N extends PatternNumber> = {

0 commit comments

Comments
 (0)