[Update] Positions/calcs finitions
This commit is contained in:
parent
387e103501
commit
174767f22c
4 changed files with 36 additions and 34 deletions
|
@ -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}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue