lines.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import type { LinePoint, LineStyleType } from '@/types/slides'
  2. import { lang } from '@/main'
  3. export interface LinePoolItem {
  4. path: string
  5. style: LineStyleType
  6. points: [LinePoint, LinePoint]
  7. isBroken?: boolean
  8. isBroken2?: boolean
  9. isCurve?: boolean
  10. isCubic?: boolean
  11. }
  12. interface PresetLine {
  13. type: string
  14. children: LinePoolItem[]
  15. }
  16. export const LINE_LIST: PresetLine[] = [
  17. {
  18. type: lang.ssLineStraight,
  19. children: [
  20. { path: 'M 0 0 L 20 20', style: 'solid', points: ['', ''] },
  21. { path: 'M 0 0 L 20 20', style: 'dashed', points: ['', ''] },
  22. { path: 'M 0 0 L 20 20', style: 'solid', points: ['', 'arrow'] },
  23. { path: 'M 0 0 L 20 20', style: 'dashed', points: ['', 'arrow'] },
  24. { path: 'M 0 0 L 20 20', style: 'solid', points: ['', 'dot'] },
  25. ],
  26. },
  27. {
  28. type: lang.ssLinePolyCurve,
  29. children: [
  30. { path: 'M 0 0 L 0 20 L 20 20', style: 'solid', points: ['', 'arrow'], isBroken: true },
  31. { path: 'M 0 0 L 10 0 L 10 20 L 20 20', style: 'solid', points: ['', 'arrow'], isBroken2: true },
  32. { path: 'M 0 0 Q 0 20 20 20', style: 'solid', points: ['', 'arrow'], isCurve: true },
  33. { path: 'M 0 0 C 20 0 0 20 20 20', style: 'solid', points: ['', 'arrow'], isCubic: true },
  34. ],
  35. },
  36. ]