Skip to content

Commit

Permalink
[sld-viewer] Center navigation arrow (#33)
Browse files Browse the repository at this point in the history
* Center navigation arrow
* Rather fail with exception than silently fail with 0 width

Signed-off-by: Florian Dupuy <[email protected]>
  • Loading branch information
flo-dup authored Feb 23, 2024
1 parent 40b6019 commit f0b01d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/single-line-diagram-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,14 @@ export class SingleLineDiagramViewer {
const xs = transform?.[0]?.match(/\d+/)?.[0];
if (xs !== undefined) {
const x = parseInt(xs, 10);
const feederWidth =
this.svgMetadata?.components.find(
(comp) => comp.type === element.componentType
).size.width || 0;
this.createSvgArrow(
elementById,
element.direction,
x,
x + feederWidth / 2,
highestY.get(element.vid),
lowestY.get(element.vid)
);
Expand Down

0 comments on commit f0b01d6

Please sign in to comment.