c6a2f01ee583dc50e6cebc47e315e2afbac001b10fe7bfd3ad94e97267d74a828a3cbcd3397f30c73036061cce45ecb3b8925dc519a206256a079ba732b508 472 B

12345678910111213
  1. import { isArray, isNumber } from '../../core/util.js';
  2. export function normalizeLineDash(lineType, lineWidth) {
  3. if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {
  4. return null;
  5. }
  6. lineWidth = lineWidth || 1;
  7. return lineType === 'dashed'
  8. ? [4 * lineWidth, 2 * lineWidth]
  9. : lineType === 'dotted'
  10. ? [lineWidth]
  11. : isNumber(lineType)
  12. ? [lineType] : isArray(lineType) ? lineType : null;
  13. }