Fix selectorSymbol not horizontally centered on the symbol
This commit is contained in:
parent
9797ada55a
commit
2b7ff3a202
1 changed files with 7 additions and 3 deletions
|
@ -19,11 +19,13 @@ export function SelectorSymbol(props: ISelectorSymbolProps): JSX.Element {
|
|||
|
||||
const scale = (props.scale ?? 1);
|
||||
const [width, height] = [
|
||||
props.selected.width,
|
||||
props.selected.width / scale,
|
||||
props.selected.height / scale
|
||||
];
|
||||
|
||||
const [x, y] = [props.selected.x, -SYMBOL_MARGIN - height];
|
||||
const [x, y] = [
|
||||
props.selected.x + props.selected.width / 2,
|
||||
-SYMBOL_MARGIN - height];
|
||||
|
||||
const xText = x + width / 2;
|
||||
const yText = y + height / 2;
|
||||
|
@ -35,7 +37,9 @@ export function SelectorSymbol(props: ISelectorSymbolProps): JSX.Element {
|
|||
transitionProperty: 'all',
|
||||
transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)',
|
||||
transitionDuration: '150ms',
|
||||
animation: 'fadein 750ms ease-in alternate infinite'
|
||||
animation: 'fadein 750ms ease-in alternate infinite',
|
||||
transform: 'translateX(-50%)',
|
||||
transformBox: 'fill-box'
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue