1
0
Fork 0

chore(components): Round point coordinates for UI

This commit is contained in:
Joost De Cock 2021-04-17 14:12:34 +02:00
parent 9d9fdc684f
commit f55cd826a7

View file

@ -28,6 +28,8 @@ const Design = (props) => {
return val return val
} }
const round = (val) => Math.round(val * 10) / 10
if (!props.design || props.focus === null || Object.keys(props.focus).length < 1) return null if (!props.design || props.focus === null || Object.keys(props.focus).length < 1) return null
let info = [] let info = []
for (let part of Object.keys(props.focus)) { for (let part of Object.keys(props.focus)) {
@ -69,10 +71,10 @@ const Design = (props) => {
</IconButton> </IconButton>
<ul key={'pdata-' + name}> <ul key={'pdata-' + name}>
<li> <li>
<b>x</b>: {point.x} <b>x</b>: {round(point.x)}
</li> </li>
<li> <li>
<b>y</b>: {point.y} <b>y</b>: {round(point.y)}
</li> </li>
{point.attributes.length > 0 && ( {point.attributes.length > 0 && (
<li> <li>