chore(components): Round point coordinates for UI
This commit is contained in:
parent
9d9fdc684f
commit
f55cd826a7
1 changed files with 4 additions and 2 deletions
|
@ -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>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue