Download src/components/slide-renderer/Editor/Canvas/AlignmentLine.tsx from muthuk1/OpenMAIC-React: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/muthuk1/OpenMAIC-React/resolve/main/src/components/slide-renderer/Editor/Canvas/AlignmentLine.tsx
- Command line
-
hf download hf://muthuk1/OpenMAIC-React/src/components/slide-renderer/Editor/Canvas/AlignmentLine.tsx
-
curl -L -o AlignmentLine.tsx https://huggingface.co/muthuk1/OpenMAIC-React/resolve/main/src/components/slide-renderer/Editor/Canvas/AlignmentLine.tsx
1.01 kB
| import type { AlignmentLineProps } from '@/lib/types/edit'; | |
| export interface AlignmentLineComponentProps extends AlignmentLineProps { | |
| canvasScale: number; | |
| } | |
| /** | |
| * Alignment line component | |
| * Displays visual alignment guides during element dragging | |
| */ | |
| export function AlignmentLine({ type, axis, length, canvasScale }: AlignmentLineComponentProps) { | |
| // Alignment line position | |
| const left = axis.x * canvasScale; | |
| const top = axis.y * canvasScale; | |
| // Alignment line length | |
| const sizeStyle = | |
| type === 'vertical' | |
| ? { height: `${length * canvasScale}px` } | |
| : { width: `${length * canvasScale}px` }; | |
| return ( | |
| <div | |
| className="alignment-line absolute z-42" | |
| style={{ | |
| left: `${left}px`, | |
| top: `${top}px`, | |
| }} | |
| > | |
| <div | |
| className={`line ${type === 'vertical' ? 'border-l border-dashed border-primary -translate-x-0.5' : 'border-t border-dashed border-primary -translate-y-0.5'}`} | |
| style={sizeStyle} | |
| /> | |
| </div> | |
| ); | |
| } | |