Factor out svg-vocabulary.ts, increase symbol padding.

pull/4/head
Atul Varma 2021-02-15 08:33:33 -05:00
rodzic 4334a3eb3c
commit 972cecb056
4 zmienionych plików z 8 dodań i 6 usunięć

2
.gitignore vendored
Wyświetl plik

@ -2,4 +2,4 @@ node_modules
dist
dist-watch
.cache
lib/svg-vocabulary.json
lib/_svg-vocabulary.json

Wyświetl plik

@ -5,10 +5,8 @@ import { FILL_REPLACEMENT_COLOR, STROKE_REPLACEMENT_COLOR } from "../colors";
import * as colors from "../colors";
import { PointWithNormal, Specs } from "../specs";
import _SvgVocabulary from "../svg-vocabulary.json";
import type { SvgSymbolData, SvgSymbolElement } from "../vocabulary";
const SvgVocabulary: SvgSymbolData[] = _SvgVocabulary as any;
import { SvgVocabulary } from "../svg-vocabulary";
type SvgSymbolContext = {
stroke: string;
@ -155,7 +153,7 @@ const SvgSymbolSpecs: React.FC<{ specs: Specs }> = ({ specs }) => {
);
};
const BBOX_DILATION = 50;
const BBOX_DILATION = 100;
const SvgSymbol: React.FC<SvgSymbolProps> = (props) => {
const d = props.data;

Wyświetl plik

@ -0,0 +1,4 @@
import type { SvgSymbolData } from "./vocabulary";
import _SvgVocabulary from "./_svg-vocabulary.json";
export const SvgVocabulary: SvgSymbolData[] = _SvgVocabulary as any;

Wyświetl plik

@ -31,7 +31,7 @@ const SUPPORTED_SVG_TAGS = new Set(SUPPORTED_SVG_TAG_ARRAY);
const MY_DIR = __dirname;
const SVG_DIR = path.join(MY_DIR, "..", "svg");
const VOCAB_PATH = path.join(MY_DIR, "svg-vocabulary.json");
const VOCAB_PATH = path.join(MY_DIR, "_svg-vocabulary.json");
const SVG_EXT = ".svg";
function onlyTags(