chore: round position

This commit is contained in:
cha0s 2019-04-14 13:28:50 -05:00
parent 5ab0c1fbe4
commit 250a980db2

View File

@ -16,7 +16,7 @@ const decorate = compose(
top: calc(180px + 0.5em);
left: 0.5em;
line-height: 1em;
width: 16em;
width: 10em;
padding: 0.125em;
font-family: monospace;
}
@ -24,11 +24,11 @@ const decorate = compose(
}
.x {
display: inline-block;
width: 8em;
width: 5em;
}
.y {
display: inline-block;
width: 7.125em;
width: 4.125em;
}
.x:before {
content: 'x: ';
@ -60,10 +60,7 @@ const SelfEntityComponent = ({selfEntityPromise}) => {
selfEntity.off('positionChanged', onPositionChanged);
};
}, [position]);
const roundedPosition = Vector.div(
Vector.floor(Vector.scale(position, 1000)),
[1000, 1000],
);
const roundedPosition = Vector.round(position);
return <div className="self-entity unselectable">
<div className="location">
<div className="x">{roundedPosition[0]}</div>