diff --git a/index.html b/index.html
index 5babdcb..4599d77 100644
--- a/index.html
+++ b/index.html
@@ -11,6 +11,15 @@ html, body {
background: #eee url('data:image/svg+xml,');
background-size: 20px 20px;
}
+
+.hover-debug-helper {
+ font-family: "Consolas", "Monaco", monospace;
+ color: white;
+ background: rgba(0, 0, 0, 0.75);
+ padding: 4px;
+ margin-top: 4px;
+ margin-left: 4px;
+}
-
- {creature}
-
+
+
+ {creature}
+
+
>
);
diff --git a/lib/pages/vocabulary-page.tsx b/lib/pages/vocabulary-page.tsx
index dfa7c0f..679f250 100644
--- a/lib/pages/vocabulary-page.tsx
+++ b/lib/pages/vocabulary-page.tsx
@@ -8,6 +8,7 @@ import {
import { SvgVocabulary } from "../svg-vocabulary";
import { SvgSymbolContext } from "../svg-symbol";
import { SymbolContextWidget } from "../symbol-context-widget";
+import { HoverDebugHelper } from "../hover-debug-helper";
type SvgSymbolProps = {
data: SvgSymbolData;
@@ -42,29 +43,31 @@ export const VocabularyPage: React.FC<{}> = () => {
<>
Mystic Symbolic Vocabulary
- {SvgVocabulary.map((symbolData) => (
-
+
+ {SvgVocabulary.map((symbolData) => (
- {symbolData.name}
+
+ {symbolData.name}
+
+
+
+
-
-
-
-
- ))}
+ ))}
+
>
);
};
diff --git a/lib/specs.ts b/lib/specs.ts
index 75a03eb..9562a31 100644
--- a/lib/specs.ts
+++ b/lib/specs.ts
@@ -31,6 +31,7 @@ export type AttachmentPointType = keyof AttachmentPointSpecs;
export type AttachmentPoint = PointWithNormal & {
type: AttachmentPointType;
+ index: number;
};
export const ATTACHMENT_POINT_TYPES: AttachmentPointType[] = [
@@ -46,8 +47,10 @@ export function* iterAttachmentPoints(specs: Specs): Iterable {
for (let type of ATTACHMENT_POINT_TYPES) {
const points = specs[type];
if (points) {
+ let index = 0;
for (let point of points) {
- yield { ...point, type };
+ yield { ...point, type, index };
+ index += 1;
}
}
}
diff --git a/lib/svg-symbol.tsx b/lib/svg-symbol.tsx
index 2463f5a..35c01a2 100644
--- a/lib/svg-symbol.tsx
+++ b/lib/svg-symbol.tsx
@@ -78,17 +78,18 @@ function reactifySvgSymbolElement(
strokeWidth = ctx.uniformStrokeWidth;
vectorEffect = "non-scaling-stroke";
}
+ const props: typeof el.props = {
+ ...el.props,
+ id: undefined,
+ vectorEffect,
+ strokeWidth,
+ fill,
+ stroke,
+ key,
+ };
return React.createElement(
el.tagName,
- {
- ...el.props,
- id: undefined,
- vectorEffect,
- strokeWidth,
- fill,
- stroke,
- key,
- },
+ props,
el.children.map(reactifySvgSymbolElement.bind(null, ctx))
);
}
@@ -99,9 +100,9 @@ export const SvgSymbolContent: React.FC<
const d = props.data;
return (
- <>
+
{props.data.layers.map(reactifySvgSymbolElement.bind(null, props))}
{props.showSpecs && d.specs && }
- >
+
);
};
diff --git a/lib/visible-specs.tsx b/lib/visible-specs.tsx
index 8b28771..7bf96c6 100644
--- a/lib/visible-specs.tsx
+++ b/lib/visible-specs.tsx
@@ -21,7 +21,7 @@ const VisibleAttachmentPoint: React.FC<{
const color = colors.ATTACHMENT_POINT_COLORS[ap.type];
return (
- <>
+
- >
+
);
};
@@ -48,6 +48,8 @@ const BoundingBoxes: React.FC<{ fill: string; bboxes: BBox[] }> = (props) => (
const [width, height] = getBoundingBoxSize(b);
return (