From fbd2a785199a26364d1ab1408792317f58b43912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=89=BF=E5=B3=B0?= <44059402+cf-19@users.noreply.github.com> Date: Tue, 25 Apr 2023 15:15:48 +0800 Subject: [PATCH 1/2] fix: fixed when the input was negative --- .../PropertiesPanel/Properties/VectorProperty.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/core/src/PropertiesPanel/Properties/VectorProperty.tsx b/packages/core/src/PropertiesPanel/Properties/VectorProperty.tsx index 36c3253..b921495 100644 --- a/packages/core/src/PropertiesPanel/Properties/VectorProperty.tsx +++ b/packages/core/src/PropertiesPanel/Properties/VectorProperty.tsx @@ -42,13 +42,13 @@ export function VectorProperty(props: IVec3Props) { const updateVec = (k: 'x' | 'y' | 'z') => { if (prop) { if (k === 'x') { - prop.x = Number.isNaN(+x) ? 0 : x; + prop.x = Number.isNaN(+x) ? prop.x : x; setX(prop.x); } else if (k === 'y') { - prop.y = Number.isNaN(+y) ? 0 : y; + prop.y = Number.isNaN(+y) ? prop.y : y; setX(prop.y); } else if (k === 'z') { - prop.z = Number.isNaN(+z) ? 0 : z; + prop.z = Number.isNaN(+z) ? prop.z : z; setZ(prop.z); } @@ -62,11 +62,11 @@ export function VectorProperty(props: IVec3Props) { const v = e.target.value; if (k === 'x') { - setX(+v); + setX(v); } else if (k === 'y') { - setY(+v); + setY(v); } else if (k === 'z') { - setZ(+v); + setZ(v); } }; From fa3257092d4a1ac3a94157584a55b8197312cab1 Mon Sep 17 00:00:00 2001 From: Changsheng Zhu Date: Tue, 25 Apr 2023 15:47:53 +0800 Subject: [PATCH 2/2] chore(changeset): add a patch `changeset` --- .changeset/shy-nails-kneel.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/shy-nails-kneel.md diff --git a/.changeset/shy-nails-kneel.md b/.changeset/shy-nails-kneel.md new file mode 100644 index 0000000..1b86007 --- /dev/null +++ b/.changeset/shy-nails-kneel.md @@ -0,0 +1,5 @@ +--- +"core": patch +--- + +fix: fixed when the input was negative