[Update] Positions/calcs finitions

This commit is contained in:
Carl Fuchs 2023-02-20 17:17:32 +01:00
parent 387e103501
commit 174767f22c
4 changed files with 36 additions and 34 deletions

View file

@ -27,19 +27,14 @@ export function SelectorSymbol(props: ISelectorSymbolProps): JSX.Element {
let x, y: number;
if (props.selected.isVertical) {
x = -SYMBOL_MARGIN;
y = (props.selected.offset + props.selected.height / 2) - height;
x = -SYMBOL_MARGIN / scale - width;
y = (props.selected.offset + props.selected.height / 2) - (props.selected.height / scale / 2);
} else {
[x, y] = [
props.selected.offset + props.selected.width / 2,
-SYMBOL_MARGIN - height];
(props.selected.offset + props.selected.width / 2) - (props.selected.width / scale / 2),
-SYMBOL_MARGIN / scale - height];
}
const style: React.CSSProperties = {
transform: 'translateX(-50%)',
transformBox: 'fill-box'
};
return (
<Selector
text={props.selected.displayedText}
@ -48,7 +43,6 @@ export function SelectorSymbol(props: ISelectorSymbolProps): JSX.Element {
width={width}
height={height}
scale={scale}
style={style}
/>
);
}