Skip to content

Commit 1bf6a0d

Browse files
committed
Make internal rotation helpers private
1 parent 2d7676d commit 1bf6a0d

1 file changed

Lines changed: 9 additions & 19 deletions

File tree

src/lib/components/canvas/nodeTransforms.ts

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,28 @@ import { historyStore } from '$lib/stores/history';
77
import type { Node } from '@xyflow/svelte';
88

99
/** Rotation values: 0=normal, 1=90°, 2=180°, 3=270° */
10-
export type RotationValue = 0 | 1 | 2 | 3;
10+
type RotationValue = 0 | 1 | 2 | 3;
1111

12-
/**
13-
* Get current rotation value from node params
14-
*/
15-
export function getRotation(nodeId: string): RotationValue {
12+
/** Get current rotation value from node params */
13+
function getRotation(nodeId: string): RotationValue {
1614
const node = graphStore.getNode(nodeId);
1715
return ((node?.params?.['_rotation'] as number) || 0) as RotationValue;
1816
}
1917

20-
/**
21-
* Calculate next rotation (90° clockwise)
22-
*/
23-
export function rotateClockwise(current: RotationValue): RotationValue {
18+
/** Calculate next rotation (90° clockwise) */
19+
function rotateClockwise(current: RotationValue): RotationValue {
2420
return ((current + 1) % 4) as RotationValue;
2521
}
2622

27-
/**
28-
* Calculate horizontal flip.
29-
* Horizontal flip swaps 0 <-> 2, leaves 1 and 3 unchanged.
30-
*/
31-
export function flipHorizontal(current: RotationValue): RotationValue {
23+
/** Horizontal flip: swaps 0 <-> 2, leaves 1 and 3 unchanged */
24+
function flipHorizontal(current: RotationValue): RotationValue {
3225
if (current === 0) return 2;
3326
if (current === 2) return 0;
3427
return current;
3528
}
3629

37-
/**
38-
* Calculate vertical flip.
39-
* Vertical flip swaps 1 <-> 3, leaves 0 and 2 unchanged.
40-
*/
41-
export function flipVertical(current: RotationValue): RotationValue {
30+
/** Vertical flip: swaps 1 <-> 3, leaves 0 and 2 unchanged */
31+
function flipVertical(current: RotationValue): RotationValue {
4232
if (current === 1) return 3;
4333
if (current === 3) return 1;
4434
return current;

0 commit comments

Comments
 (0)