+Added Vector3 class and replaced all position and angle values with it to clean up the code *Minor bugfixes and code cleanup
19 lines
430 B
JavaScript
19 lines
430 B
JavaScript
export default function SwitchNameRenderer(props) {
|
|
const { object } = props;
|
|
const [x, y] = object.pos.toSVGCoords();
|
|
const text = object.id_switch;
|
|
|
|
return (
|
|
<text
|
|
x={x}
|
|
y={y}
|
|
textAnchor='middle'
|
|
id={`switch-${object.id}`}
|
|
style={{ userSelect: "none" }}
|
|
className="switch-name"
|
|
>
|
|
{text}
|
|
</text>
|
|
);
|
|
}
|