From 1e89f7803a48beaedc4573dc26d060d741972b92 Mon Sep 17 00:00:00 2001 From: Eric NGUYEN Date: Thu, 23 Feb 2023 12:24:34 +0100 Subject: [PATCH] Symbol: Apply the width/height offset --- .../SVG/Elements/SelectorSymbol/SelectorSymbol.tsx | 6 ++---- src/Components/SVG/Elements/Symbol.tsx | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Components/SVG/Elements/SelectorSymbol/SelectorSymbol.tsx b/src/Components/SVG/Elements/SelectorSymbol/SelectorSymbol.tsx index 4f0fc82..22f4800 100644 --- a/src/Components/SVG/Elements/SelectorSymbol/SelectorSymbol.tsx +++ b/src/Components/SVG/Elements/SelectorSymbol/SelectorSymbol.tsx @@ -3,8 +3,6 @@ import * as React from 'react'; import { DIMENSION_MARGIN, SYMBOL_MARGIN } from '../../../../utils/default'; import { type ISymbolModel } from '../../../../Interfaces/ISymbolModel'; import { Selector } from '../Selector/Selector'; -import { TransformX, TransformY } from '../../../../utils/svg'; -import { PositionReference } from '../../../../Enums/PositionReference'; interface ISelectorSymbolProps { symbols: Map @@ -25,11 +23,11 @@ export function SelectorSymbol(props: ISelectorSymbolProps): JSX.Element { const scaledWidth = props.selected.width; if (props.selected.isVertical) { - x = -DIMENSION_MARGIN; + x = -SYMBOL_MARGIN - props.selected.width; y = props.selected.offset; } else { x = props.selected.offset; - y = -DIMENSION_MARGIN; + y = -SYMBOL_MARGIN - props.selected.height; } return ( diff --git a/src/Components/SVG/Elements/Symbol.tsx b/src/Components/SVG/Elements/Symbol.tsx index dcdf707..c3a6eb8 100644 --- a/src/Components/SVG/Elements/Symbol.tsx +++ b/src/Components/SVG/Elements/Symbol.tsx @@ -16,11 +16,11 @@ export function Symbol(props: ISymbolProps): JSX.Element { let x, y: number; if (props.model.isVertical) { - x = -SYMBOL_MARGIN; + x = -SYMBOL_MARGIN - props.model.width; y = props.model.offset; } else { x = props.model.offset; - y = -SYMBOL_MARGIN; + y = -SYMBOL_MARGIN - props.model.height; } if (hasSVG) {